From b0ad6a21c12fed9dd5c24f43c090c124d5408ff7 Mon Sep 17 00:00:00 2001 From: Stefan Ernst <24554551+stefan-ernst@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:24:40 +0100 Subject: [PATCH 1/2] feat: compose customer boards and Compact portals (WI-2240) --- api/openapi-v2.json | 13494 ++++++++++------ frontend/src/lib/api/boardPublications.js | 34 + frontend/src/lib/api/portalBoards.js | 28 + .../src/lib/customer/CompactKnowledge.svelte | 45 + .../src/lib/customer/CompactPortal.svelte | 74 + .../lib/customer/CompactPortalModule.svelte | 81 + .../src/lib/customer/CustomerBoundary.svelte | 7 +- .../src/lib/customer/CustomerHeader.svelte | 27 + .../src/lib/customer/CustomerLogin.svelte | 3 +- .../lib/customer/CustomerPolicyFields.svelte | 26 + .../src/lib/customer/CustomerPortal.svelte | 4 +- .../src/lib/customer/PortalExperience.svelte | 25 + .../src/lib/customer/compactNavigation.js | 54 + .../src/lib/dialogs/ChannelConfigModal.svelte | 11 +- .../src/lib/dialogs/RequestFormModal.svelte | 7 +- .../channels/ChannelPortalConfig.svelte | 28 +- .../src/lib/features/channels/Channels.svelte | 9 +- .../features/channels/ManagerChannels.svelte | 20 +- .../channels/PortalBoardPlacements.svelte | 88 + .../channels/PortalChannelPage.svelte | 9 + .../BoardPublicationLocations.svelte | 19 + .../collections/BoardSharingEditor.svelte | 132 + .../collections/CollectionViewSwitcher.svelte | 27 +- .../features/collections/Collections.svelte | 13 +- .../collections/CollectionsBreadcrumbs.svelte | 2 +- .../PublicBoardSharingDialog.svelte | 12 +- frontend/src/lib/layout/Portal.svelte | 23 +- frontend/src/lib/pages/PublicBoard.svelte | 66 +- .../lib/pages/PublicBoardItemDetail.svelte | 4 +- .../src/lib/portal/PortalKBArticle.svelte | 3 +- frontend/src/lib/router.js | 2 + .../src/lib/services/authenticatedShellUI.js | 1 + frontend/src/lib/settings/PublicBoards.svelte | 89 + .../src/lib/settings/SecuritySettings.svelte | 14 + frontend/src/lib/stores/permissions.svelte.js | 14 +- frontend/src/lib/stores/portal.svelte.js | 9 +- frontend/src/lib/stores/portalAuth.svelte.js | 7 +- .../database/board_publication_migration.go | 33 + internal/database/migrations.go | 16 + internal/database/schema/system.sql | 10 + internal/database/schema/system_postgres.sql | 10 + internal/handlers/customer_access.go | 97 +- internal/handlers/portal_boards.go | 249 + internal/handlers/portal_bootstrap.go | 19 +- internal/handlers/public_board.go | 106 +- internal/handlers/security_settings.go | 37 +- internal/handlers/shell_bootstrap.go | 21 +- internal/logger/audit.go | 30 +- internal/models/board_publication.go | 16 + internal/models/customer_experience.go | 32 + internal/models/item.go | 9 + internal/models/portal.go | 12 +- internal/repository/audit_log_repository.go | 12 + .../repository/board_placement_repository.go | 56 + internal/repository/collection_repository.go | 74 +- .../repository/customer_access_repository.go | 21 +- internal/restapi/v2/audit_coverage.go | 7 + .../restapi/v2/board_contract_metadata.go | 77 + internal/restapi/v2/board_placements.go | 119 + internal/restapi/v2/board_publications.go | 130 + internal/restapi/v2/contract-metadata.json | 898 +- internal/restapi/v2/customer_access.go | 48 +- internal/restapi/v2/portal_boards.go | 37 + internal/restapi/v2/router.go | 4 + internal/server/server.go | 7 +- internal/services/board_placement_service.go | 212 + .../services/board_publication_inventory.go | 203 + internal/services/board_sharing_service.go | 415 + .../services/channel_config_update_service.go | 13 +- .../collection_application_service.go | 150 +- .../services/portal_experience_service.go | 149 + 71 files changed, 12628 insertions(+), 5212 deletions(-) create mode 100644 frontend/src/lib/api/boardPublications.js create mode 100644 frontend/src/lib/api/portalBoards.js create mode 100644 frontend/src/lib/customer/CompactKnowledge.svelte create mode 100644 frontend/src/lib/customer/CompactPortal.svelte create mode 100644 frontend/src/lib/customer/CompactPortalModule.svelte create mode 100644 frontend/src/lib/customer/CustomerHeader.svelte create mode 100644 frontend/src/lib/customer/CustomerPolicyFields.svelte create mode 100644 frontend/src/lib/customer/PortalExperience.svelte create mode 100644 frontend/src/lib/customer/compactNavigation.js create mode 100644 frontend/src/lib/features/channels/PortalBoardPlacements.svelte create mode 100644 frontend/src/lib/features/collections/BoardPublicationLocations.svelte create mode 100644 frontend/src/lib/features/collections/BoardSharingEditor.svelte create mode 100644 frontend/src/lib/settings/PublicBoards.svelte create mode 100644 internal/database/board_publication_migration.go create mode 100644 internal/handlers/portal_boards.go create mode 100644 internal/models/board_publication.go create mode 100644 internal/models/customer_experience.go create mode 100644 internal/repository/board_placement_repository.go create mode 100644 internal/restapi/v2/board_contract_metadata.go create mode 100644 internal/restapi/v2/board_placements.go create mode 100644 internal/restapi/v2/board_publications.go create mode 100644 internal/restapi/v2/portal_boards.go create mode 100644 internal/services/board_placement_service.go create mode 100644 internal/services/board_publication_inventory.go create mode 100644 internal/services/board_sharing_service.go create mode 100644 internal/services/portal_experience_service.go diff --git a/api/openapi-v2.json b/api/openapi-v2.json index 10e999a3f..9d987ab83 100644 --- a/api/openapi-v2.json +++ b/api/openapi-v2.json @@ -1820,6 +1820,237 @@ ], "type": "object" }, + "GetAdminBoardPublicationsResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "can_administer": { + "description": "The can administer value.", + "type": "boolean" + }, + "changed_at": { + "description": "The changed at value.", + "nullable": true, + "type": "string" + }, + "changed_by": { + "description": "The changed by value.", + "nullable": true, + "type": "integer" + }, + "changed_by_name": { + "description": "The changed by name value.", + "type": "string" + }, + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "instance_enabled": { + "description": "The instance enabled value.", + "type": "boolean" + }, + "locations": { + "description": "The locations value.", + "items": { + "additionalProperties": false, + "properties": { + "channel_id": { + "description": "The channel id value.", + "nullable": true, + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "kind": { + "description": "The kind value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "url": { + "description": "The url value.", + "type": "string" + } + }, + "required": [ + "effective_policy", + "enabled", + "kind", + "label", + "url" + ], + "type": "object" + }, + "type": "array" + }, + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "organisations": { + "description": "The organisations value.", + "items": { + "additionalProperties": false, + "properties": { + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "owner_active": { + "description": "The owner active value.", + "nullable": true, + "type": "boolean" + }, + "owner_id": { + "description": "The owner id value.", + "nullable": true, + "type": "integer" + }, + "owner_name": { + "description": "The owner name value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "revoke_reason": { + "description": "The revoke reason value.", + "type": "string" + }, + "revoked_at": { + "description": "The revoked at value.", + "nullable": true, + "type": "string" + }, + "scope": { + "description": "The scope value.", + "type": "string" + }, + "slug": { + "description": "The slug value.", + "nullable": true, + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + }, + "workspace_name": { + "description": "The workspace name value.", + "type": "string" + } + }, + "required": [ + "can_administer", + "changed_by_name", + "collection_id", + "enabled", + "instance_enabled", + "locations", + "milestone_swimlanes", + "name", + "organisations", + "owner_name", + "policy", + "revision", + "revoke_reason", + "scope", + "standalone_enabled", + "workspace_name" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "type": "object" + }, "GetAdminObjectTranslationsCanonicalDifferencesResult": { "additionalProperties": false, "properties": { @@ -5805,469 +6036,284 @@ "format": "binary", "type": "string" }, - "GetCatalogsGlobalBootstrapResult": { + "GetBoardPublicationsCollectionIdHistoryResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "action": { + "description": "The action value.", + "type": "string" + }, + "actor_id": { + "description": "The actor id value.", + "nullable": true, + "type": "integer" + }, + "actor_name": { + "description": "The actor name value.", + "type": "string" + }, + "after": { + "description": "The after value.", + "format": "byte", + "type": "string" + }, + "before": { + "description": "The before value.", + "format": "byte", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "reason": { + "description": "The reason value.", + "type": "string" + } + }, + "required": [ + "action", + "actor_name", + "after", + "before", + "created_at", + "id", + "reason" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetBoardPublicationsCollectionIdResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, + "nullable": true, "properties": { - "custom_field_definitions": { - "description": "The custom field definitions value.", + "can_administer": { + "description": "The can administer value.", + "type": "boolean" + }, + "changed_at": { + "description": "The changed at value.", + "nullable": true, + "type": "string" + }, + "changed_by": { + "description": "The changed by value.", + "nullable": true, + "type": "integer" + }, + "changed_by_name": { + "description": "The changed by name value.", + "type": "string" + }, + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "instance_enabled": { + "description": "The instance enabled value.", + "type": "boolean" + }, + "locations": { + "description": "The locations value.", "items": { "additionalProperties": false, "properties": { - "applies_to_customer_organisations": { - "description": "The applies to customer organisations value.", - "type": "boolean" - }, - "applies_to_portal_customers": { - "description": "The applies to portal customers value.", - "type": "boolean" - }, - "asset_type_usages": { - "description": "The asset type usages value.", - "items": { - "additionalProperties": false, - "properties": { - "asset_type_name": { - "description": "The asset type name value.", - "type": "string" - }, - "set_name": { - "description": "The set name value.", - "type": "string" - } - }, - "required": [ - "asset_type_name", - "set_name" - ], - "type": "object" - }, - "type": "array" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "field_type": { - "description": "The field type value.", - "type": "string" - }, - "id": { - "description": "The id value.", + "channel_id": { + "description": "The channel id value.", + "nullable": true, "type": "integer" }, - "indexed": { + "effective_policy": { "additionalProperties": false, - "description": "The indexed value.", + "description": "The effective policy value.", "properties": { - "assets": { - "description": "The assets value.", - "type": "boolean" + "mode": { + "description": "The mode value.", + "type": "string" }, - "items": { - "description": "The items value.", - "type": "boolean" + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" } }, "required": [ - "assets", - "items" + "mode", + "organisation_ids" ], "type": "object" }, - "name": { - "description": "The name value.", - "type": "string" - }, - "options": { - "additionalProperties": { - "description": "Arbitrary JSON extension value." - }, - "description": "The options value.", - "type": "object" - }, - "required": { - "description": "The required value.", - "type": "boolean" - }, - "system_default": { - "description": "The system default value.", + "enabled": { + "description": "The enabled value.", "type": "boolean" - } - }, - "required": [ - "applies_to_customer_organisations", - "applies_to_portal_customers", - "asset_type_usages", - "description", - "display_order", - "field_type", - "id", - "indexed", - "name", - "options", - "required", - "system_default" - ], - "type": "object" - }, - "type": "array" - }, - "custom_fields_error": { - "description": "The custom fields error value.", - "nullable": true, - "type": "string" - }, - "item_types": { - "description": "The item types value.", - "items": { - "additionalProperties": false, - "properties": { - "builtin_key": { - "description": "The builtin key value.", - "nullable": true, - "type": "string" - }, - "color": { - "description": "The color value.", - "type": "string" }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_description": { - "description": "The display description value.", - "type": "string" - }, - "display_name": { - "description": "The display name value.", + "kind": { + "description": "The kind value.", "type": "string" }, - "hierarchy_level": { - "description": "The hierarchy level value.", - "type": "integer" - }, - "icon": { - "description": "The icon value.", + "label": { + "description": "The label value.", "type": "string" }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_default": { - "description": "The is default value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", + "url": { + "description": "The url value.", "type": "string" - }, - "sort_order": { - "description": "The sort order value.", - "type": "integer" } }, "required": [ - "color", - "description", - "display_description", - "display_name", - "hierarchy_level", - "icon", - "id", - "is_default", - "name", - "sort_order" + "effective_policy", + "enabled", + "kind", + "label", + "url" ], "type": "object" }, "type": "array" }, - "priorities": { - "description": "The priorities value.", - "items": { - "additionalProperties": false, - "properties": { - "builtin_key": { - "description": "The builtin key value.", - "nullable": true, - "type": "string" - }, - "color": { - "description": "The color value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_description": { - "description": "The display description value.", - "type": "string" - }, - "display_name": { - "description": "The display name value.", - "type": "string" - }, - "icon": { - "description": "The icon value.", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_default": { - "description": "The is default value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "sort_order": { - "description": "The sort order value.", - "type": "integer" - } - }, - "required": [ - "color", - "description", - "display_description", - "display_name", - "icon", - "id", - "is_default", - "name", - "sort_order" - ], - "type": "object" - }, - "type": "array" + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" }, - "status_categories": { - "description": "The status categories value.", + "name": { + "description": "The name value.", + "type": "string" + }, + "organisations": { + "description": "The organisations value.", "items": { "additionalProperties": false, "properties": { - "builtin_key": { - "description": "The builtin key value.", - "nullable": true, - "type": "string" - }, - "color": { - "description": "The color value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_description": { - "description": "The display description value.", - "type": "string" - }, - "display_name": { - "description": "The display name value.", - "type": "string" - }, "id": { "description": "The id value.", "type": "integer" }, - "is_completed": { - "description": "The is completed value.", - "type": "boolean" - }, - "is_default": { - "description": "The is default value.", - "type": "boolean" - }, "name": { "description": "The name value.", "type": "string" } }, "required": [ - "color", - "description", - "display_description", - "display_name", "id", - "is_completed", - "is_default", "name" ], "type": "object" }, "type": "array" }, - "statuses": { - "description": "The statuses value.", - "items": { - "additionalProperties": false, - "properties": { - "builtin_key": { - "description": "The builtin key value.", - "nullable": true, - "type": "string" - }, - "category": { - "additionalProperties": false, - "description": "The category value.", - "properties": { - "builtin_key": { - "description": "The builtin key value.", - "nullable": true, - "type": "string" - }, - "color": { - "description": "The color value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_description": { - "description": "The display description value.", - "type": "string" - }, - "display_name": { - "description": "The display name value.", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_completed": { - "description": "The is completed value.", - "type": "boolean" - }, - "is_default": { - "description": "The is default value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", - "type": "string" - } - }, - "required": [ - "color", - "description", - "display_description", - "display_name", - "id", - "is_completed", - "is_default", - "name" - ], - "type": "object" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_description": { - "description": "The display description value.", - "type": "string" - }, - "display_name": { - "description": "The display name value.", - "type": "string" - }, - "id": { - "description": "The id value.", + "owner_active": { + "description": "The owner active value.", + "nullable": true, + "type": "boolean" + }, + "owner_id": { + "description": "The owner id value.", + "nullable": true, + "type": "integer" + }, + "owner_name": { + "description": "The owner name value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { "type": "integer" }, - "is_default": { - "description": "The is default value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", - "type": "string" - } - }, - "required": [ - "category", - "description", - "display_description", - "display_name", - "id", - "is_default", - "name" - ], - "type": "object" + "type": "array" + } }, - "type": "array" - } - }, - "required": [ - "custom_field_definitions", - "item_types", - "priorities", - "status_categories", - "statuses" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "GetCollectionCategoriesCategoryIdResult": { - "additionalProperties": false, - "properties": { - "data": { - "additionalProperties": false, - "properties": { - "color": { - "description": "The color value.", - "type": "string" + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" }, - "created_at": { - "description": "The created at value.", - "format": "date-time", + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "revoke_reason": { + "description": "The revoke reason value.", "type": "string" }, - "description": { - "description": "The description value.", + "revoked_at": { + "description": "The revoked at value.", + "nullable": true, "type": "string" }, - "id": { - "description": "The id value.", - "type": "integer" + "scope": { + "description": "The scope value.", + "type": "string" }, - "name": { - "description": "The name value.", + "slug": { + "description": "The slug value.", + "nullable": true, "type": "string" }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + }, + "workspace_name": { + "description": "The workspace name value.", "type": "string" } }, "required": [ - "color", - "created_at", - "description", - "id", + "can_administer", + "changed_by_name", + "collection_id", + "enabled", + "instance_enabled", + "locations", + "milestone_swimlanes", "name", - "updated_at" + "organisations", + "owner_name", + "policy", + "revision", + "revoke_reason", + "scope", + "standalone_enabled", + "workspace_name" ], "type": "object" } @@ -6277,47 +6323,222 @@ ], "type": "object" }, - "GetCollectionCategoriesResult": { + "GetBoardPublicationsResult": { "additionalProperties": false, "properties": { "data": { "items": { "additionalProperties": false, "properties": { - "color": { - "description": "The color value.", - "type": "string" + "can_administer": { + "description": "The can administer value.", + "type": "boolean" }, - "created_at": { - "description": "The created at value.", - "format": "date-time", + "changed_at": { + "description": "The changed at value.", + "nullable": true, "type": "string" }, - "description": { - "description": "The description value.", + "changed_by": { + "description": "The changed by value.", + "nullable": true, + "type": "integer" + }, + "changed_by_name": { + "description": "The changed by name value.", "type": "string" }, - "id": { - "description": "The id value.", + "collection_id": { + "description": "The collection id value.", "type": "integer" }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "instance_enabled": { + "description": "The instance enabled value.", + "type": "boolean" + }, + "locations": { + "description": "The locations value.", + "items": { + "additionalProperties": false, + "properties": { + "channel_id": { + "description": "The channel id value.", + "nullable": true, + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "kind": { + "description": "The kind value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "url": { + "description": "The url value.", + "type": "string" + } + }, + "required": [ + "effective_policy", + "enabled", + "kind", + "label", + "url" + ], + "type": "object" + }, + "type": "array" + }, + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" + }, "name": { "description": "The name value.", "type": "string" }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", + "organisations": { + "description": "The organisations value.", + "items": { + "additionalProperties": false, + "properties": { + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "owner_active": { + "description": "The owner active value.", + "nullable": true, + "type": "boolean" + }, + "owner_id": { + "description": "The owner id value.", + "nullable": true, + "type": "integer" + }, + "owner_name": { + "description": "The owner name value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "revoke_reason": { + "description": "The revoke reason value.", + "type": "string" + }, + "revoked_at": { + "description": "The revoked at value.", + "nullable": true, + "type": "string" + }, + "scope": { + "description": "The scope value.", + "type": "string" + }, + "slug": { + "description": "The slug value.", + "nullable": true, + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + }, + "workspace_name": { + "description": "The workspace name value.", "type": "string" } }, "required": [ - "color", - "created_at", - "description", - "id", + "can_administer", + "changed_by_name", + "collection_id", + "enabled", + "instance_enabled", + "locations", + "milestone_swimlanes", "name", - "updated_at" + "organisations", + "owner_name", + "policy", + "revision", + "revoke_reason", + "scope", + "standalone_enabled", + "workspace_name" ], "type": "object" }, @@ -6333,366 +6554,137 @@ ], "type": "object" }, - "GetCollectionsCollectionIdBoardConfigurationBootstrapResult": { + "GetCatalogsGlobalBootstrapResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, "properties": { - "board_configuration": { - "additionalProperties": false, - "description": "The board configuration value.", - "nullable": true, - "properties": { - "backlog_status_ids": { - "description": "The backlog status ids value.", - "items": { + "custom_field_definitions": { + "description": "The custom field definitions value.", + "items": { + "additionalProperties": false, + "properties": { + "applies_to_customer_organisations": { + "description": "The applies to customer organisations value.", + "type": "boolean" + }, + "applies_to_portal_customers": { + "description": "The applies to portal customers value.", + "type": "boolean" + }, + "asset_type_usages": { + "description": "The asset type usages value.", + "items": { + "additionalProperties": false, + "properties": { + "asset_type_name": { + "description": "The asset type name value.", + "type": "string" + }, + "set_name": { + "description": "The set name value.", + "type": "string" + } + }, + "required": [ + "asset_type_name", + "set_name" + ], + "type": "object" + }, + "type": "array" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "display_order": { + "description": "The display order value.", "type": "integer" }, - "type": "array" - }, - "card_fields": { - "description": "The card fields value.", - "items": { + "field_type": { + "description": "The field type value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "indexed": { "additionalProperties": false, + "description": "The indexed value.", "properties": { - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "field_identifier": { - "description": "The field identifier value.", - "type": "string" - }, - "field_type": { - "description": "The field type value.", - "type": "string" + "assets": { + "description": "The assets value.", + "type": "boolean" }, - "width": { - "description": "The width value.", - "type": "integer" + "items": { + "description": "The items value.", + "type": "boolean" } }, "required": [ - "display_order", - "field_identifier", - "field_type", - "width" + "assets", + "items" ], "type": "object" }, - "type": "array" - }, - "collection_id": { - "description": "The collection id value.", - "nullable": true, - "type": "integer" - }, - "columns": { - "description": "The columns value.", - "items": { - "additionalProperties": false, - "properties": { - "board_configuration_id": { - "description": "The board configuration id value.", - "type": "integer" - }, - "color": { - "description": "The color value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "status_ids": { - "description": "The status ids value.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "wip_limit": { - "description": "The wip limit value.", - "nullable": true, - "type": "integer" - } + "name": { + "description": "The name value.", + "type": "string" + }, + "options": { + "additionalProperties": { + "description": "Arbitrary JSON extension value." }, - "required": [ - "board_configuration_id", - "color", - "created_at", - "display_order", - "id", - "name", - "updated_at" - ], + "description": "The options value.", "type": "object" }, - "type": "array" - }, - "completed_item_retention_days": { - "description": "The completed item retention days value.", - "nullable": true, - "type": "integer" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" + "required": { + "description": "The required value.", + "type": "boolean" + }, + "system_default": { + "description": "The system default value.", + "type": "boolean" + } }, - "list_columns": { - "description": "The list columns value.", - "items": { - "additionalProperties": false, - "properties": { - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "field_identifier": { - "description": "The field identifier value.", - "type": "string" - }, - "field_type": { - "description": "The field type value.", - "type": "string" - }, - "width": { - "description": "The width value.", - "type": "integer" - } - }, - "required": [ - "display_order", - "field_identifier", - "field_type", - "width" - ], - "type": "object" - }, - "type": "array" - }, - "roadmap_config": { - "additionalProperties": false, - "description": "The roadmap config value.", - "nullable": true, - "properties": { - "dependency_link_type_id": { - "description": "The dependency link type id value.", - "nullable": true, - "type": "integer" - }, - "end_field_id": { - "description": "The end field id value.", - "type": "string" - }, - "start_field_id": { - "description": "The start field id value.", - "type": "string" - } - }, - "required": [ - "end_field_id", - "start_field_id" - ], - "type": "object" - }, - "show_rightmost_column_last_50": { - "description": "The show rightmost column last 50 value.", - "type": "boolean" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "view_settings": { - "additionalProperties": false, - "description": "The view settings value.", - "nullable": true, - "properties": { - "completed_limit": { - "description": "The completed limit value.", - "nullable": true, - "type": "integer" - }, - "completed_visibility": { - "description": "The completed visibility value.", - "nullable": true, - "type": "string" - }, - "enabled_views": { - "description": "The enabled views value.", - "items": { - "type": "string" - }, - "nullable": true, - "type": "array" - }, - "milestone_swimlanes": { - "additionalProperties": false, - "description": "The milestone swimlanes value.", - "nullable": true, - "properties": { - "global_milestone_ids": { - "description": "The global milestone ids value.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "show_completed": { - "description": "The show completed value.", - "type": "boolean" - }, - "show_open_from_completed": { - "description": "The show open from completed value.", - "type": "boolean" - } - }, - "required": [ - "show_completed", - "show_open_from_completed" - ], - "type": "object" - } - }, - "type": "object" - }, - "view_settings_inherited": { - "description": "The view settings inherited value.", - "type": "boolean" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" - } + "required": [ + "applies_to_customer_organisations", + "applies_to_portal_customers", + "asset_type_usages", + "description", + "display_order", + "field_type", + "id", + "indexed", + "name", + "options", + "required", + "system_default" + ], + "type": "object" }, - "required": [ - "created_at", - "id", - "show_rightmost_column_last_50", - "updated_at" - ], - "type": "object" + "type": "array" }, - "collection": { - "additionalProperties": false, - "description": "The collection value.", + "custom_fields_error": { + "description": "The custom fields error value.", "nullable": true, - "properties": { - "created_by": { - "description": "The created by value.", - "nullable": true, - "type": "integer" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_public": { - "description": "The is public value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "public_slug": { - "description": "The public slug value.", - "nullable": true, - "type": "string" - }, - "ql_query": { - "description": "The ql query value.", - "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" - } - }, - "required": [ - "description", - "id", - "is_public", - "name", - "ql_query" - ], - "type": "object" - }, - "referenced_workspace_ids": { - "description": "The referenced workspace ids value.", - "items": { - "type": "integer" - }, - "type": "array" + "type": "string" }, - "statuses": { - "description": "The statuses value.", + "item_types": { + "description": "The item types value.", "items": { "additionalProperties": false, "properties": { "builtin_key": { "description": "The builtin key value.", + "nullable": true, "type": "string" }, - "category_builtin_key": { - "description": "The category builtin key value.", - "type": "string" - }, - "category_color": { - "description": "The category color value.", - "type": "string" - }, - "category_description": { - "description": "The category description value.", - "type": "string" - }, - "category_id": { - "description": "The category id value.", - "type": "integer" - }, - "category_is_default": { - "description": "The category is default value.", - "type": "boolean" - }, - "category_name": { - "description": "The category name value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", + "color": { + "description": "The color value.", "type": "string" }, "description": { @@ -6707,14 +6699,18 @@ "description": "The display name value.", "type": "string" }, + "hierarchy_level": { + "description": "The hierarchy level value.", + "type": "integer" + }, + "icon": { + "description": "The icon value.", + "type": "string" + }, "id": { "description": "The id value.", "type": "integer" }, - "is_completed": { - "description": "The is completed value.", - "type": "boolean" - }, "is_default": { "description": "The is default value.", "type": "boolean" @@ -6723,298 +6719,255 @@ "description": "The name value.", "type": "string" }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" + "sort_order": { + "description": "The sort order value.", + "type": "integer" } }, "required": [ - "category_id", - "created_at", + "color", "description", + "display_description", "display_name", + "hierarchy_level", + "icon", "id", "is_default", "name", - "updated_at" + "sort_order" ], "type": "object" }, "type": "array" - } - }, - "required": [ - "referenced_workspace_ids", - "statuses" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "GetCollectionsCollectionIdBoardConfigurationResult": { - "additionalProperties": false, - "properties": { - "data": { - "additionalProperties": false, - "properties": { - "backlog_status_ids": { - "description": "The backlog status ids value.", - "items": { - "type": "integer" - }, - "type": "array" }, - "card_fields": { - "description": "The card fields value.", + "priorities": { + "description": "The priorities value.", "items": { "additionalProperties": false, "properties": { - "display_order": { - "description": "The display order value.", - "type": "integer" + "builtin_key": { + "description": "The builtin key value.", + "nullable": true, + "type": "string" }, - "field_identifier": { - "description": "The field identifier value.", + "color": { + "description": "The color value.", "type": "string" }, - "field_type": { - "description": "The field type value.", + "description": { + "description": "The description value.", "type": "string" }, - "width": { - "description": "The width value.", + "display_description": { + "description": "The display description value.", + "type": "string" + }, + "display_name": { + "description": "The display name value.", + "type": "string" + }, + "icon": { + "description": "The icon value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_default": { + "description": "The is default value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "sort_order": { + "description": "The sort order value.", "type": "integer" } }, "required": [ - "display_order", - "field_identifier", - "field_type", - "width" + "color", + "description", + "display_description", + "display_name", + "icon", + "id", + "is_default", + "name", + "sort_order" ], "type": "object" }, "type": "array" }, - "collection_id": { - "description": "The collection id value.", - "nullable": true, - "type": "integer" - }, - "columns": { - "description": "The columns value.", + "status_categories": { + "description": "The status categories value.", "items": { "additionalProperties": false, "properties": { - "board_configuration_id": { - "description": "The board configuration id value.", - "type": "integer" + "builtin_key": { + "description": "The builtin key value.", + "nullable": true, + "type": "string" }, "color": { "description": "The color value.", "type": "string" }, - "created_at": { - "description": "The created at value.", - "format": "date-time", + "description": { + "description": "The description value.", "type": "string" }, - "display_order": { - "description": "The display order value.", - "type": "integer" + "display_description": { + "description": "The display description value.", + "type": "string" + }, + "display_name": { + "description": "The display name value.", + "type": "string" }, "id": { "description": "The id value.", "type": "integer" }, - "name": { - "description": "The name value.", - "type": "string" + "is_completed": { + "description": "The is completed value.", + "type": "boolean" }, - "status_ids": { - "description": "The status ids value.", - "items": { - "type": "integer" - }, - "type": "array" + "is_default": { + "description": "The is default value.", + "type": "boolean" }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", + "name": { + "description": "The name value.", "type": "string" - }, - "wip_limit": { - "description": "The wip limit value.", - "nullable": true, - "type": "integer" } }, "required": [ - "board_configuration_id", "color", - "created_at", - "display_order", + "description", + "display_description", + "display_name", "id", - "name", - "updated_at" + "is_completed", + "is_default", + "name" ], "type": "object" }, "type": "array" }, - "completed_item_retention_days": { - "description": "The completed item retention days value.", - "nullable": true, - "type": "integer" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "list_columns": { - "description": "The list columns value.", + "statuses": { + "description": "The statuses value.", "items": { "additionalProperties": false, "properties": { - "display_order": { - "description": "The display order value.", - "type": "integer" + "builtin_key": { + "description": "The builtin key value.", + "nullable": true, + "type": "string" }, - "field_identifier": { - "description": "The field identifier value.", + "category": { + "additionalProperties": false, + "description": "The category value.", + "properties": { + "builtin_key": { + "description": "The builtin key value.", + "nullable": true, + "type": "string" + }, + "color": { + "description": "The color value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "display_description": { + "description": "The display description value.", + "type": "string" + }, + "display_name": { + "description": "The display name value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_completed": { + "description": "The is completed value.", + "type": "boolean" + }, + "is_default": { + "description": "The is default value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "color", + "description", + "display_description", + "display_name", + "id", + "is_completed", + "is_default", + "name" + ], + "type": "object" + }, + "description": { + "description": "The description value.", "type": "string" }, - "field_type": { - "description": "The field type value.", + "display_description": { + "description": "The display description value.", "type": "string" }, - "width": { - "description": "The width value.", + "display_name": { + "description": "The display name value.", + "type": "string" + }, + "id": { + "description": "The id value.", "type": "integer" - } - }, - "required": [ - "display_order", - "field_identifier", - "field_type", - "width" + }, + "is_default": { + "description": "The is default value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "category", + "description", + "display_description", + "display_name", + "id", + "is_default", + "name" ], "type": "object" }, "type": "array" - }, - "roadmap_config": { - "additionalProperties": false, - "description": "The roadmap config value.", - "nullable": true, - "properties": { - "dependency_link_type_id": { - "description": "The dependency link type id value.", - "nullable": true, - "type": "integer" - }, - "end_field_id": { - "description": "The end field id value.", - "type": "string" - }, - "start_field_id": { - "description": "The start field id value.", - "type": "string" - } - }, - "required": [ - "end_field_id", - "start_field_id" - ], - "type": "object" - }, - "show_rightmost_column_last_50": { - "description": "The show rightmost column last 50 value.", - "type": "boolean" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "view_settings": { - "additionalProperties": false, - "description": "The view settings value.", - "nullable": true, - "properties": { - "completed_limit": { - "description": "The completed limit value.", - "nullable": true, - "type": "integer" - }, - "completed_visibility": { - "description": "The completed visibility value.", - "nullable": true, - "type": "string" - }, - "enabled_views": { - "description": "The enabled views value.", - "items": { - "type": "string" - }, - "nullable": true, - "type": "array" - }, - "milestone_swimlanes": { - "additionalProperties": false, - "description": "The milestone swimlanes value.", - "nullable": true, - "properties": { - "global_milestone_ids": { - "description": "The global milestone ids value.", - "items": { - "type": "integer" - }, - "type": "array" - }, - "show_completed": { - "description": "The show completed value.", - "type": "boolean" - }, - "show_open_from_completed": { - "description": "The show open from completed value.", - "type": "boolean" - } - }, - "required": [ - "show_completed", - "show_open_from_completed" - ], - "type": "object" - } - }, - "type": "object" - }, - "view_settings_inherited": { - "description": "The view settings inherited value.", - "type": "boolean" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" } }, "required": [ - "created_at", - "id", - "show_rightmost_column_last_50", - "updated_at" + "custom_field_definitions", + "item_types", + "priorities", + "status_categories", + "statuses" ], "type": "object" } @@ -7024,58 +6977,128 @@ ], "type": "object" }, - "GetCollectionsCollectionIdQueuesResult": { + "GetChannelsChannelIdBoardPlacementsResult": { "additionalProperties": false, "properties": { "data": { "items": { "additionalProperties": false, "properties": { - "builtin": { - "description": "The builtin value.", - "type": "boolean" + "baseline_policy": { + "additionalProperties": false, + "description": "The baseline policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" }, - "count": { - "description": "The count value.", + "channel_id": { + "description": "The channel id value.", "type": "integer" }, - "description": { - "description": "The description value.", - "type": "string" + "collection_id": { + "description": "The collection id value.", + "type": "integer" }, - "filter_state": { - "description": "The filter state value.", + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", "nullable": true, - "type": "string" + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" }, "id": { "description": "The id value.", - "type": "integer" - }, - "key": { - "description": "The key value.", "type": "string" }, - "name": { - "description": "The name value.", + "label": { + "description": "The label value.", "type": "string" }, - "position": { - "description": "The position value.", + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", "type": "integer" }, - "ql": { - "description": "The ql value.", + "source_name": { + "description": "The source name value.", "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" } }, "required": [ - "builtin", - "count", + "channel_id", + "collection_id", + "display_order", + "enabled", "id", - "name", - "position", - "ql" + "label", + "policy", + "revision", + "standalone_enabled" ], "type": "object" }, @@ -7087,100 +7110,46 @@ ], "type": "object" }, - "GetCollectionsCollectionIdResult": { + "GetChannelsChannelIdExperienceResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, + "nullable": true, "properties": { - "category_color": { - "description": "The category color value.", - "type": "string" - }, - "category_id": { - "description": "The category id value.", - "nullable": true, - "type": "integer" - }, - "category_name": { - "description": "The category name value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "type": "string" - }, - "created_by": { - "description": "The created by value.", - "nullable": true, - "type": "integer" - }, - "creator_email": { - "description": "The creator email value.", - "type": "string" - }, - "creator_name": { - "description": "The creator name value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "filter_state": { - "description": "The filter state value.", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_private": { - "description": "The is private value.", - "type": "boolean" - }, - "is_public": { - "description": "The is public value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", + "default_module": { + "description": "The default module value.", "type": "string" }, - "public_milestone_swimlanes": { - "description": "The public milestone swimlanes value.", - "type": "boolean" + "modules": { + "description": "The modules value.", + "items": { + "type": "string" + }, + "type": "array" }, - "public_slug": { - "description": "The public slug value.", - "nullable": true, - "type": "string" + "navigation": { + "description": "The navigation value.", + "items": { + "type": "string" + }, + "type": "array" }, - "ql_query": { - "description": "The ql query value.", + "presentation": { + "description": "The presentation value.", "type": "string" }, - "updated_at": { - "description": "The updated at value.", + "revision": { + "description": "The revision value.", "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" } }, "required": [ - "created_at", - "description", - "id", - "is_private", - "is_public", - "name", - "public_milestone_swimlanes", - "ql_query", - "updated_at" + "default_module", + "modules", + "navigation", + "presentation", + "revision" ], "type": "object" } @@ -7190,49 +7159,45 @@ ], "type": "object" }, - "GetCollectionsCollectionIdTestCoverageConfigResult": { + "GetCollectionCategoriesCategoryIdResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, - "nullable": true, "properties": { - "collection_id": { - "description": "The collection id value.", - "nullable": true, - "type": "integer" + "color": { + "description": "The color value.", + "type": "string" }, "created_at": { "description": "The created at value.", "format": "date-time", "type": "string" }, + "description": { + "description": "The description value.", + "type": "string" + }, "id": { "description": "The id value.", "type": "integer" }, - "requirement_item_type_ids": { - "description": "The requirement item type ids value.", - "items": { - "type": "integer" - }, - "type": "array" + "name": { + "description": "The name value.", + "type": "string" }, "updated_at": { "description": "The updated at value.", "format": "date-time", "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" } }, "required": [ + "color", "created_at", + "description", "id", - "requirement_item_type_ids", + "name", "updated_at" ], "type": "object" @@ -7243,562 +7208,744 @@ ], "type": "object" }, - "GetCollectionsCollectionIdTestCoverageRequirementsResult": { + "GetCollectionCategoriesResult": { "additionalProperties": false, "properties": { "data": { "items": { "additionalProperties": false, "properties": { - "is_covered": { - "description": "The is covered value.", - "type": "boolean" - }, - "item_id": { - "description": "The item id value.", - "type": "integer" - }, - "item_type_color": { - "description": "The item type color value.", + "color": { + "description": "The color value.", "type": "string" }, - "item_type_icon": { - "description": "The item type icon value.", + "created_at": { + "description": "The created at value.", + "format": "date-time", "type": "string" }, - "item_type_id": { - "description": "The item type id value.", - "type": "integer" - }, - "item_type_name": { - "description": "The item type name value.", + "description": { + "description": "The description value.", "type": "string" }, - "linked_test_count": { - "description": "The linked test count value.", - "type": "integer" - }, - "status_id": { - "description": "The status id value.", - "nullable": true, + "id": { + "description": "The id value.", "type": "integer" }, - "status_name": { - "description": "The status name value.", - "type": "string" - }, - "title": { - "description": "The title value.", + "name": { + "description": "The name value.", "type": "string" }, - "workspace_item_number": { - "description": "The workspace item number value.", - "type": "integer" - }, - "workspace_key": { - "description": "The workspace key value.", + "updated_at": { + "description": "The updated at value.", + "format": "date-time", "type": "string" } }, "required": [ - "is_covered", - "item_id", - "item_type_color", - "item_type_icon", - "item_type_id", - "item_type_name", - "linked_test_count", - "title", - "workspace_item_number", - "workspace_key" + "color", + "created_at", + "description", + "id", + "name", + "updated_at" ], "type": "object" }, "type": "array" }, - "meta": { - "additionalProperties": false, - "properties": { - "summary": { - "additionalProperties": false, - "description": "The summary value.", - "properties": { - "coverage_rate": { - "description": "The coverage rate value.", - "type": "number" - }, - "covered": { - "description": "The covered value.", - "type": "integer" - }, - "not_covered": { - "description": "The not covered value.", - "type": "integer" - }, - "total": { - "description": "The total value.", - "type": "integer" - } - }, - "required": [ - "coverage_rate", - "covered", - "not_covered", - "total" - ], - "type": "object" - } - }, - "required": [ - "summary" - ], - "type": "object" - }, "pagination": { "$ref": "#/components/schemas/Pagination" } }, "required": [ "data", - "pagination", - "meta" + "pagination" ], "type": "object" }, - "GetCollectionsCollectionIdTestCoverageSummaryResult": { + "GetCollectionsCollectionIdBoardConfigurationBootstrapResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, "properties": { - "coverage_rate": { - "description": "The coverage rate value.", - "type": "number" - }, - "covered": { - "description": "The covered value.", - "type": "integer" - }, - "not_covered": { - "description": "The not covered value.", - "type": "integer" - }, - "total": { - "description": "The total value.", - "type": "integer" - } - }, - "required": [ - "coverage_rate", - "covered", - "not_covered", - "total" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "GetCollectionsResult": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "additionalProperties": false, - "properties": { - "category_color": { - "description": "The category color value.", - "type": "string" - }, - "category_id": { - "description": "The category id value.", - "nullable": true, - "type": "integer" - }, - "category_name": { - "description": "The category name value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "type": "string" - }, - "created_by": { - "description": "The created by value.", - "nullable": true, - "type": "integer" - }, - "creator_email": { - "description": "The creator email value.", - "type": "string" - }, - "creator_name": { - "description": "The creator name value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "filter_state": { - "description": "The filter state value.", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_private": { - "description": "The is private value.", - "type": "boolean" - }, - "is_public": { - "description": "The is public value.", - "type": "boolean" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "public_milestone_swimlanes": { - "description": "The public milestone swimlanes value.", - "type": "boolean" - }, - "public_slug": { - "description": "The public slug value.", - "nullable": true, - "type": "string" - }, - "ql_query": { - "description": "The ql query value.", - "type": "string" - }, - "updated_at": { - "description": "The updated at value.", - "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" - } - }, - "required": [ - "created_at", - "description", - "id", - "is_private", - "is_public", - "name", - "public_milestone_swimlanes", - "ql_query", - "updated_at" - ], - "type": "object" - }, - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" - } - }, - "required": [ - "data", - "pagination" - ], - "type": "object" - }, - "GetCommentsCommentIdResult": { - "additionalProperties": false, - "properties": { - "data": { - "additionalProperties": false, - "properties": { - "agent_owner_name": { - "description": "The agent owner name value.", - "type": "string" - }, - "author_avatar": { - "description": "The author avatar value.", - "type": "string" - }, - "author_email": { - "description": "The author email value.", - "type": "string" - }, - "author_id": { - "description": "The author id value.", - "nullable": true, - "type": "integer" - }, - "author_name": { - "description": "The author name value.", - "type": "string" - }, - "content": { - "description": "The content value.", - "type": "string" - }, - "content_html": { - "description": "The content html value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_agent": { - "description": "The is agent value.", - "type": "boolean" - }, - "is_private": { - "description": "The is private value.", - "type": "boolean" - }, - "item_id": { - "description": "The item id value.", - "type": "integer" - }, - "portal_customer_id": { - "description": "The portal customer id value.", + "board_configuration": { + "additionalProperties": false, + "description": "The board configuration value.", "nullable": true, - "type": "integer" - }, - "reactions": { - "description": "The reactions value.", - "items": { - "additionalProperties": false, - "properties": { - "count": { - "description": "The count value.", + "properties": { + "backlog_status_ids": { + "description": "The backlog status ids value.", + "items": { "type": "integer" }, - "reaction": { - "description": "The reaction value.", - "type": "string" - }, - "user_ids": { - "description": "The user ids value.", - "items": { - "type": "integer" + "type": "array" + }, + "card_fields": { + "description": "The card fields value.", + "items": { + "additionalProperties": false, + "properties": { + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "field_identifier": { + "description": "The field identifier value.", + "type": "string" + }, + "field_type": { + "description": "The field type value.", + "type": "string" + }, + "width": { + "description": "The width value.", + "type": "integer" + } }, - "type": "array" + "required": [ + "display_order", + "field_identifier", + "field_type", + "width" + ], + "type": "object" }, - "user_names": { - "description": "The user names value.", - "items": { - "type": "string" - }, - "type": "array" - } + "type": "array" }, - "required": [ - "count", - "reaction", - "user_ids", - "user_names" - ], - "type": "object" - }, - "type": "array" - }, - "source": { - "description": "The source value.", - "type": "string" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - } - }, - "required": [ - "content", - "created_at", - "id", - "is_private", - "item_id", - "source", - "updated_at" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "GetConditionSetsConditionSetIdResult": { - "additionalProperties": false, - "properties": { - "data": { - "additionalProperties": false, - "properties": { - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "gated_transitions": { - "description": "The gated transitions value.", - "items": { - "additionalProperties": false, - "properties": { - "from_all_statuses": { - "description": "The from all statuses value.", - "type": "boolean" - }, - "from_status_name": { - "description": "The from status name value.", - "type": "string" + "collection_id": { + "description": "The collection id value.", + "nullable": true, + "type": "integer" + }, + "columns": { + "description": "The columns value.", + "items": { + "additionalProperties": false, + "properties": { + "board_configuration_id": { + "description": "The board configuration id value.", + "type": "integer" + }, + "color": { + "description": "The color value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "status_ids": { + "description": "The status ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "wip_limit": { + "description": "The wip limit value.", + "nullable": true, + "type": "integer" + } + }, + "required": [ + "board_configuration_id", + "color", + "created_at", + "display_order", + "id", + "name", + "updated_at" + ], + "type": "object" }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" + "type": "array" + }, + "completed_item_retention_days": { + "description": "The completed item retention days value.", + "nullable": true, + "type": "integer" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "list_columns": { + "description": "The list columns value.", + "items": { + "additionalProperties": false, + "properties": { + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "field_identifier": { + "description": "The field identifier value.", + "type": "string" + }, + "field_type": { + "description": "The field type value.", + "type": "string" + }, + "width": { + "description": "The width value.", + "type": "integer" + } + }, + "required": [ + "display_order", + "field_identifier", + "field_type", + "width" + ], + "type": "object" }, - "transition_id": { - "description": "The transition id value.", - "type": "integer" - } + "type": "array" }, - "required": [ - "to_status_name", - "transition_id" - ], - "type": "object" - }, - "type": "array" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "transition_conditions": { - "description": "The transition conditions value.", - "items": { - "additionalProperties": false, - "properties": { - "condition_set_id": { - "description": "The condition set id value.", - "type": "integer" + "roadmap_config": { + "additionalProperties": false, + "description": "The roadmap config value.", + "nullable": true, + "properties": { + "dependency_link_type_id": { + "description": "The dependency link type id value.", + "nullable": true, + "type": "integer" + }, + "end_field_id": { + "description": "The end field id value.", + "type": "string" + }, + "start_field_id": { + "description": "The start field id value.", + "type": "string" + } }, - "conditions": { - "description": "The conditions value.", - "items": { + "required": [ + "end_field_id", + "start_field_id" + ], + "type": "object" + }, + "show_rightmost_column_last_50": { + "description": "The show rightmost column last 50 value.", + "type": "boolean" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "view_settings": { + "additionalProperties": false, + "description": "The view settings value.", + "nullable": true, + "properties": { + "completed_limit": { + "description": "The completed limit value.", + "nullable": true, + "type": "integer" + }, + "completed_visibility": { + "description": "The completed visibility value.", + "nullable": true, + "type": "string" + }, + "enabled_views": { + "description": "The enabled views value.", + "items": { + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "milestone_swimlanes": { "additionalProperties": false, + "description": "The milestone swimlanes value.", + "nullable": true, "properties": { - "condition_set_transition_id": { - "description": "The condition set transition id value.", - "type": "integer" - }, - "condition_type": { - "description": "The condition type value.", - "type": "string" - }, - "config": { - "description": "The config value.", - "format": "byte", - "type": "string" - }, - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "error_message": { - "description": "The error message value.", - "type": "string" + "global_milestone_ids": { + "description": "The global milestone ids value.", + "items": { + "type": "integer" + }, + "type": "array" }, - "id": { - "description": "The id value.", - "type": "integer" + "show_completed": { + "description": "The show completed value.", + "type": "boolean" }, - "mode": { - "description": "The mode value.", - "type": "string" + "show_open_from_completed": { + "description": "The show open from completed value.", + "type": "boolean" } }, "required": [ - "condition_set_transition_id", - "condition_type", - "config", - "display_order", - "id", - "mode" + "show_completed", + "show_open_from_completed" ], "type": "object" - }, - "type": "array" + } }, - "from_status_name": { - "description": "The from status name value.", + "type": "object" + }, + "view_settings_inherited": { + "description": "The view settings inherited value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + } + }, + "required": [ + "created_at", + "id", + "show_rightmost_column_last_50", + "updated_at" + ], + "type": "object" + }, + "collection": { + "additionalProperties": false, + "description": "The collection value.", + "nullable": true, + "properties": { + "created_by": { + "description": "The created by value.", + "nullable": true, + "type": "integer" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_public": { + "description": "The is public value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "public_slug": { + "description": "The public slug value.", + "nullable": true, + "type": "string" + }, + "ql_query": { + "description": "The ql query value.", + "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + } + }, + "required": [ + "description", + "id", + "is_public", + "name", + "ql_query" + ], + "type": "object" + }, + "referenced_workspace_ids": { + "description": "The referenced workspace ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "statuses": { + "description": "The statuses value.", + "items": { + "additionalProperties": false, + "properties": { + "builtin_key": { + "description": "The builtin key value.", + "type": "string" + }, + "category_builtin_key": { + "description": "The category builtin key value.", + "type": "string" + }, + "category_color": { + "description": "The category color value.", + "type": "string" + }, + "category_description": { + "description": "The category description value.", + "type": "string" + }, + "category_id": { + "description": "The category id value.", + "type": "integer" + }, + "category_is_default": { + "description": "The category is default value.", + "type": "boolean" + }, + "category_name": { + "description": "The category name value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "display_description": { + "description": "The display description value.", + "type": "string" + }, + "display_name": { + "description": "The display name value.", "type": "string" }, "id": { "description": "The id value.", "type": "integer" }, - "logic_mode": { - "description": "The logic mode value.", + "is_completed": { + "description": "The is completed value.", + "type": "boolean" + }, + "is_default": { + "description": "The is default value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", "type": "string" }, - "to_status_name": { - "description": "The to status name value.", + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "category_id", + "created_at", + "description", + "display_name", + "id", + "is_default", + "name", + "updated_at" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "referenced_workspace_ids", + "statuses" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetCollectionsCollectionIdBoardConfigurationResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "backlog_status_ids": { + "description": "The backlog status ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "card_fields": { + "description": "The card fields value.", + "items": { + "additionalProperties": false, + "properties": { + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "field_identifier": { + "description": "The field identifier value.", "type": "string" }, - "transition_id": { - "description": "The transition id value.", + "field_type": { + "description": "The field type value.", + "type": "string" + }, + "width": { + "description": "The width value.", "type": "integer" } }, "required": [ - "condition_set_id", + "display_order", + "field_identifier", + "field_type", + "width" + ], + "type": "object" + }, + "type": "array" + }, + "collection_id": { + "description": "The collection id value.", + "nullable": true, + "type": "integer" + }, + "columns": { + "description": "The columns value.", + "items": { + "additionalProperties": false, + "properties": { + "board_configuration_id": { + "description": "The board configuration id value.", + "type": "integer" + }, + "color": { + "description": "The color value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "status_ids": { + "description": "The status ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "wip_limit": { + "description": "The wip limit value.", + "nullable": true, + "type": "integer" + } + }, + "required": [ + "board_configuration_id", + "color", + "created_at", + "display_order", "id", - "logic_mode", - "transition_id" + "name", + "updated_at" ], "type": "object" }, "type": "array" }, - "updated_at": { - "description": "The updated at value.", + "completed_item_retention_days": { + "description": "The completed item retention days value.", + "nullable": true, + "type": "integer" + }, + "created_at": { + "description": "The created at value.", "format": "date-time", "type": "string" }, - "workflow_id": { - "description": "The workflow id value.", + "id": { + "description": "The id value.", "type": "integer" }, - "workflow_name": { - "description": "The workflow name value.", + "list_columns": { + "description": "The list columns value.", + "items": { + "additionalProperties": false, + "properties": { + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "field_identifier": { + "description": "The field identifier value.", + "type": "string" + }, + "field_type": { + "description": "The field type value.", + "type": "string" + }, + "width": { + "description": "The width value.", + "type": "integer" + } + }, + "required": [ + "display_order", + "field_identifier", + "field_type", + "width" + ], + "type": "object" + }, + "type": "array" + }, + "roadmap_config": { + "additionalProperties": false, + "description": "The roadmap config value.", + "nullable": true, + "properties": { + "dependency_link_type_id": { + "description": "The dependency link type id value.", + "nullable": true, + "type": "integer" + }, + "end_field_id": { + "description": "The end field id value.", + "type": "string" + }, + "start_field_id": { + "description": "The start field id value.", + "type": "string" + } + }, + "required": [ + "end_field_id", + "start_field_id" + ], + "type": "object" + }, + "show_rightmost_column_last_50": { + "description": "The show rightmost column last 50 value.", + "type": "boolean" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", "type": "string" + }, + "view_settings": { + "additionalProperties": false, + "description": "The view settings value.", + "nullable": true, + "properties": { + "completed_limit": { + "description": "The completed limit value.", + "nullable": true, + "type": "integer" + }, + "completed_visibility": { + "description": "The completed visibility value.", + "nullable": true, + "type": "string" + }, + "enabled_views": { + "description": "The enabled views value.", + "items": { + "type": "string" + }, + "nullable": true, + "type": "array" + }, + "milestone_swimlanes": { + "additionalProperties": false, + "description": "The milestone swimlanes value.", + "nullable": true, + "properties": { + "global_milestone_ids": { + "description": "The global milestone ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "show_completed": { + "description": "The show completed value.", + "type": "boolean" + }, + "show_open_from_completed": { + "description": "The show open from completed value.", + "type": "boolean" + } + }, + "required": [ + "show_completed", + "show_open_from_completed" + ], + "type": "object" + } + }, + "type": "object" + }, + "view_settings_inherited": { + "description": "The view settings inherited value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" } }, "required": [ "created_at", - "description", "id", - "name", - "updated_at", - "workflow_id" + "show_rightmost_column_last_50", + "updated_at" ], "type": "object" } @@ -7808,1265 +7955,1568 @@ ], "type": "object" }, - "GetConditionSetsResult": { + "GetCollectionsCollectionIdQueuesResult": { "additionalProperties": false, "properties": { "data": { "items": { "additionalProperties": false, "properties": { - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" + "builtin": { + "description": "The builtin value.", + "type": "boolean" + }, + "count": { + "description": "The count value.", + "type": "integer" }, "description": { "description": "The description value.", "type": "string" }, - "gated_transitions": { - "description": "The gated transitions value.", - "items": { - "additionalProperties": false, - "properties": { - "from_all_statuses": { - "description": "The from all statuses value.", - "type": "boolean" - }, - "from_status_name": { - "description": "The from status name value.", - "type": "string" - }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" - }, - "transition_id": { - "description": "The transition id value.", - "type": "integer" - } - }, - "required": [ - "to_status_name", - "transition_id" - ], - "type": "object" - }, - "type": "array" + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" }, "id": { "description": "The id value.", "type": "integer" }, + "key": { + "description": "The key value.", + "type": "string" + }, "name": { "description": "The name value.", "type": "string" }, - "transition_conditions": { - "description": "The transition conditions value.", - "items": { - "additionalProperties": false, - "properties": { - "condition_set_id": { - "description": "The condition set id value.", - "type": "integer" - }, - "conditions": { - "description": "The conditions value.", - "items": { - "additionalProperties": false, - "properties": { - "condition_set_transition_id": { - "description": "The condition set transition id value.", - "type": "integer" - }, - "condition_type": { - "description": "The condition type value.", - "type": "string" - }, - "config": { - "description": "The config value.", - "format": "byte", - "type": "string" - }, - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "error_message": { - "description": "The error message value.", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "mode": { - "description": "The mode value.", - "type": "string" - } - }, - "required": [ - "condition_set_transition_id", - "condition_type", - "config", - "display_order", - "id", - "mode" - ], - "type": "object" - }, - "type": "array" - }, - "from_status_name": { - "description": "The from status name value.", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "logic_mode": { - "description": "The logic mode value.", - "type": "string" - }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" - }, - "transition_id": { - "description": "The transition id value.", - "type": "integer" - } - }, - "required": [ - "condition_set_id", - "id", - "logic_mode", - "transition_id" - ], - "type": "object" - }, - "type": "array" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "workflow_id": { - "description": "The workflow id value.", + "position": { + "description": "The position value.", "type": "integer" }, - "workflow_name": { - "description": "The workflow name value.", + "ql": { + "description": "The ql value.", "type": "string" } }, "required": [ - "created_at", - "description", + "builtin", + "count", "id", "name", - "updated_at", - "workflow_id" + "position", + "ql" ], "type": "object" }, "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" } }, "required": [ - "data", - "pagination" + "data" ], "type": "object" }, - "GetConfigurationSetsConfigurationSetIdExportResult": { + "GetCollectionsCollectionIdResult": { "additionalProperties": false, - "nullable": true, "properties": { - "exported_at": { - "description": "The exported at value.", - "format": "date-time", - "type": "string" - }, - "exported_by": { + "data": { "additionalProperties": false, - "description": "The exported by value.", - "nullable": true, "properties": { - "instance": { - "description": "The instance value.", + "board_enabled": { + "description": "The board enabled value.", + "type": "boolean" + }, + "board_ever_published": { + "description": "The board ever published value.", + "type": "boolean" + }, + "board_standalone_enabled": { + "description": "The board standalone enabled value.", + "type": "boolean" + }, + "category_color": { + "description": "The category color value.", "type": "string" }, - "username": { - "description": "The username value.", + "category_id": { + "description": "The category id value.", + "nullable": true, + "type": "integer" + }, + "category_name": { + "description": "The category name value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "type": "string" + }, + "created_by": { + "description": "The created by value.", + "nullable": true, + "type": "integer" + }, + "creator_email": { + "description": "The creator email value.", + "type": "string" + }, + "creator_name": { + "description": "The creator name value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_private": { + "description": "The is private value.", + "type": "boolean" + }, + "is_public": { + "description": "The is public value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "public_milestone_swimlanes": { + "description": "The public milestone swimlanes value.", + "type": "boolean" + }, + "public_revoke_reason": { + "description": "The public revoke reason value.", + "type": "string" + }, + "public_revoked_at": { + "description": "The public revoked at value.", + "nullable": true, + "type": "string" + }, + "public_revoked_by": { + "description": "The public revoked by value.", + "nullable": true, + "type": "integer" + }, + "public_slug": { + "description": "The public slug value.", + "nullable": true, + "type": "string" + }, + "ql_query": { + "description": "The ql query value.", + "type": "string" + }, + "sharing_changed_at": { + "description": "The sharing changed at value.", + "nullable": true, + "type": "string" + }, + "sharing_changed_by": { + "description": "The sharing changed by value.", + "nullable": true, + "type": "integer" + }, + "sharing_revision": { + "description": "The sharing revision value.", + "type": "integer" + }, + "updated_at": { + "description": "The updated at value.", "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" } }, + "required": [ + "board_enabled", + "board_ever_published", + "board_standalone_enabled", + "created_at", + "description", + "id", + "is_private", + "is_public", + "name", + "public_milestone_swimlanes", + "public_revoke_reason", + "ql_query", + "sharing_revision", + "updated_at" + ], "type": "object" - }, - "kind": { - "description": "The kind value.", - "type": "string" - }, - "payload": { + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetCollectionsCollectionIdTestCoverageConfigResult": { + "additionalProperties": false, + "properties": { + "data": { "additionalProperties": false, - "description": "The payload value.", + "nullable": true, "properties": { - "approval_sets": { - "description": "The approval sets value.", + "collection_id": { + "description": "The collection id value.", + "nullable": true, + "type": "integer" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "requirement_item_type_ids": { + "description": "The requirement item type ids value.", "items": { - "additionalProperties": false, - "properties": { - "description": { - "description": "The description value.", - "type": "string" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "set_statuses": { - "description": "The set statuses value.", - "items": { - "additionalProperties": false, - "properties": { - "approve_transition": { - "additionalProperties": false, - "description": "The approve transition value.", - "properties": { - "from_all_statuses": { - "description": "The from all statuses value.", - "type": "boolean" - }, - "from_status_name": { - "description": "The from status name value.", - "nullable": true, - "type": "string" - }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" - } - }, - "required": [ - "to_status_name" - ], - "type": "object" - }, - "deny_transition": { - "additionalProperties": false, - "description": "The deny transition value.", - "properties": { - "from_all_statuses": { - "description": "The from all statuses value.", - "type": "boolean" - }, - "from_status_name": { - "description": "The from status name value.", - "nullable": true, - "type": "string" - }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" - } - }, - "required": [ - "to_status_name" - ], - "type": "object" - }, - "status_name": { - "description": "The status name value.", - "type": "string" - }, - "step_mode": { - "description": "The step mode value.", - "type": "string" - }, - "steps": { - "description": "The steps value.", - "items": { - "additionalProperties": false, - "properties": { - "allow_self_approval": { - "description": "The allow self approval value.", - "type": "boolean" - }, - "approver_custom_field_name": { - "description": "The approver custom field name value.", - "type": "string" - }, - "approver_field_identifier": { - "description": "The approver field identifier value.", - "type": "string" - }, - "approver_group_name": { - "description": "The approver group name value.", - "type": "string" - }, - "approver_role_name": { - "description": "The approver role name value.", - "type": "string" - }, - "approver_source": { - "description": "The approver source value.", - "type": "string" - }, - "approver_user_email": { - "description": "The approver user email value.", - "type": "string" - }, - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "escalation_action": { - "description": "The escalation action value.", - "type": "string" - }, - "escalation_after_hours": { - "description": "The escalation after hours value.", - "nullable": true, - "type": "integer" - }, - "escalation_target_custom_field_name": { - "description": "The escalation target custom field name value.", - "type": "string" - }, - "escalation_target_field_identifier": { - "description": "The escalation target field identifier value.", - "type": "string" - }, - "escalation_target_group_name": { - "description": "The escalation target group name value.", - "type": "string" - }, - "escalation_target_role_name": { - "description": "The escalation target role name value.", - "type": "string" - }, - "escalation_target_source": { - "description": "The escalation target source value.", - "type": "string" - }, - "escalation_target_user_email": { - "description": "The escalation target user email value.", - "type": "string" - }, - "max_escalations": { - "description": "The max escalations value.", - "nullable": true, - "type": "integer" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "on_leave_strategy": { - "description": "The on leave strategy value.", - "type": "string" - }, - "quorum_count": { - "description": "The quorum count value.", - "nullable": true, - "type": "integer" - }, - "quorum_mode": { - "description": "The quorum mode value.", - "type": "string" - }, - "quorum_percent": { - "description": "The quorum percent value.", - "nullable": true, - "type": "integer" - }, - "rejection_policy": { - "description": "The rejection policy value.", - "type": "string" - } - }, - "required": [ - "approver_source", - "display_order", - "on_leave_strategy", - "quorum_mode", - "rejection_policy" - ], - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "approve_transition", - "deny_transition", - "status_name", - "step_mode" - ], - "type": "object" - }, - "type": "array" - }, - "workflow_name": { - "description": "The workflow name value.", - "type": "string" - } - }, - "required": [ - "name", - "workflow_name" - ], - "type": "object" + "type": "integer" }, "type": "array" }, - "condition_sets": { - "description": "The condition sets value.", - "items": { - "additionalProperties": false, - "properties": { - "description": { - "description": "The description value.", - "type": "string" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "transition_conditions": { - "description": "The transition conditions value.", - "items": { - "additionalProperties": false, - "properties": { - "conditions": { - "description": "The conditions value.", - "items": { - "additionalProperties": false, - "properties": { - "config": { - "additionalProperties": { - "description": "Arbitrary JSON extension value." - }, - "description": "The config value.", - "type": "object" - }, - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "error_message": { - "description": "The error message value.", - "type": "string" - }, - "mode": { - "description": "The mode value.", - "type": "string" - }, - "type": { - "description": "The type value.", - "type": "string" - } - }, - "required": [ - "config", - "mode", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "from_all_statuses": { - "description": "The from all statuses value.", - "type": "boolean" - }, - "from_status_name": { - "description": "The from status name value.", - "nullable": true, - "type": "string" - }, - "logic_mode": { - "description": "The logic mode value.", - "type": "string" - }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" - } - }, - "required": [ - "logic_mode", - "to_status_name" - ], - "type": "object" - }, - "type": "array" - }, - "workflow_name": { - "description": "The workflow name value.", - "type": "string" - } - }, - "required": [ - "name", - "workflow_name" - ], - "type": "object" + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + } + }, + "required": [ + "created_at", + "id", + "requirement_item_type_ids", + "updated_at" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetCollectionsCollectionIdTestCoverageRequirementsResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "is_covered": { + "description": "The is covered value.", + "type": "boolean" }, - "type": "array" + "item_id": { + "description": "The item id value.", + "type": "integer" + }, + "item_type_color": { + "description": "The item type color value.", + "type": "string" + }, + "item_type_icon": { + "description": "The item type icon value.", + "type": "string" + }, + "item_type_id": { + "description": "The item type id value.", + "type": "integer" + }, + "item_type_name": { + "description": "The item type name value.", + "type": "string" + }, + "linked_test_count": { + "description": "The linked test count value.", + "type": "integer" + }, + "status_id": { + "description": "The status id value.", + "nullable": true, + "type": "integer" + }, + "status_name": { + "description": "The status name value.", + "type": "string" + }, + "title": { + "description": "The title value.", + "type": "string" + }, + "workspace_item_number": { + "description": "The workspace item number value.", + "type": "integer" + }, + "workspace_key": { + "description": "The workspace key value.", + "type": "string" + } }, - "configuration_set": { + "required": [ + "is_covered", + "item_id", + "item_type_color", + "item_type_icon", + "item_type_id", + "item_type_name", + "linked_test_count", + "title", + "workspace_item_number", + "workspace_key" + ], + "type": "object" + }, + "type": "array" + }, + "meta": { + "additionalProperties": false, + "properties": { + "summary": { "additionalProperties": false, - "description": "The configuration set value.", + "description": "The summary value.", "properties": { - "default_item_type_name": { - "description": "The default item type name value.", - "type": "string" + "coverage_rate": { + "description": "The coverage rate value.", + "type": "number" }, - "description": { - "description": "The description value.", - "type": "string" + "covered": { + "description": "The covered value.", + "type": "integer" }, - "differentiate_by_item_type": { - "description": "The differentiate by item type value.", - "type": "boolean" + "not_covered": { + "description": "The not covered value.", + "type": "integer" }, - "name": { - "description": "The name value.", - "type": "string" + "total": { + "description": "The total value.", + "type": "integer" } }, "required": [ - "name" + "coverage_rate", + "covered", + "not_covered", + "total" ], "type": "object" + } + }, + "required": [ + "summary" + ], + "type": "object" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination", + "meta" + ], + "type": "object" + }, + "GetCollectionsCollectionIdTestCoverageSummaryResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "coverage_rate": { + "description": "The coverage rate value.", + "type": "number" }, - "configuration_set_links": { - "additionalProperties": false, - "description": "The configuration set links value.", - "properties": { - "approval_set_name": { - "description": "The approval set name value.", - "type": "string" - }, - "condition_set_name": { - "description": "The condition set name value.", - "type": "string" - }, - "create_screen_name": { - "description": "The create screen name value.", - "type": "string" - }, - "edit_screen_name": { - "description": "The edit screen name value.", - "type": "string" - }, - "item_type_configs": { - "description": "The item type configs value.", - "items": { - "additionalProperties": false, - "properties": { - "approval_set_name": { - "description": "The approval set name value.", - "type": "string" - }, - "condition_set_name": { - "description": "The condition set name value.", - "type": "string" - }, - "create_screen_name": { - "description": "The create screen name value.", - "type": "string" - }, - "edit_screen_name": { - "description": "The edit screen name value.", - "type": "string" - }, - "item_type_name": { - "description": "The item type name value.", - "type": "string" - }, - "view_screen_name": { - "description": "The view screen name value.", - "type": "string" - }, - "workflow_name": { - "description": "The workflow name value.", - "type": "string" - } - }, - "required": [ - "item_type_name" - ], - "type": "object" - }, - "type": "array" - }, - "priority_names": { - "description": "The priority names value.", - "items": { - "type": "string" - }, - "type": "array" - }, - "view_screen_name": { - "description": "The view screen name value.", - "type": "string" - }, - "workflow_name": { - "description": "The workflow name value.", - "type": "string" - } + "covered": { + "description": "The covered value.", + "type": "integer" + }, + "not_covered": { + "description": "The not covered value.", + "type": "integer" + }, + "total": { + "description": "The total value.", + "type": "integer" + } + }, + "required": [ + "coverage_rate", + "covered", + "not_covered", + "total" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetCollectionsResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "board_enabled": { + "description": "The board enabled value.", + "type": "boolean" }, - "type": "object" + "board_ever_published": { + "description": "The board ever published value.", + "type": "boolean" + }, + "board_standalone_enabled": { + "description": "The board standalone enabled value.", + "type": "boolean" + }, + "category_color": { + "description": "The category color value.", + "type": "string" + }, + "category_id": { + "description": "The category id value.", + "nullable": true, + "type": "integer" + }, + "category_name": { + "description": "The category name value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "type": "string" + }, + "created_by": { + "description": "The created by value.", + "nullable": true, + "type": "integer" + }, + "creator_email": { + "description": "The creator email value.", + "type": "string" + }, + "creator_name": { + "description": "The creator name value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_private": { + "description": "The is private value.", + "type": "boolean" + }, + "is_public": { + "description": "The is public value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "public_milestone_swimlanes": { + "description": "The public milestone swimlanes value.", + "type": "boolean" + }, + "public_revoke_reason": { + "description": "The public revoke reason value.", + "type": "string" + }, + "public_revoked_at": { + "description": "The public revoked at value.", + "nullable": true, + "type": "string" + }, + "public_revoked_by": { + "description": "The public revoked by value.", + "nullable": true, + "type": "integer" + }, + "public_slug": { + "description": "The public slug value.", + "nullable": true, + "type": "string" + }, + "ql_query": { + "description": "The ql query value.", + "type": "string" + }, + "sharing_changed_at": { + "description": "The sharing changed at value.", + "nullable": true, + "type": "string" + }, + "sharing_changed_by": { + "description": "The sharing changed by value.", + "nullable": true, + "type": "integer" + }, + "sharing_revision": { + "description": "The sharing revision value.", + "type": "integer" + }, + "updated_at": { + "description": "The updated at value.", + "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + } }, - "custom_fields": { - "description": "The custom fields value.", + "required": [ + "board_enabled", + "board_ever_published", + "board_standalone_enabled", + "created_at", + "description", + "id", + "is_private", + "is_public", + "name", + "public_milestone_swimlanes", + "public_revoke_reason", + "ql_query", + "sharing_revision", + "updated_at" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "type": "object" + }, + "GetCommentsCommentIdResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "agent_owner_name": { + "description": "The agent owner name value.", + "type": "string" + }, + "author_avatar": { + "description": "The author avatar value.", + "type": "string" + }, + "author_email": { + "description": "The author email value.", + "type": "string" + }, + "author_id": { + "description": "The author id value.", + "nullable": true, + "type": "integer" + }, + "author_name": { + "description": "The author name value.", + "type": "string" + }, + "content": { + "description": "The content value.", + "type": "string" + }, + "content_html": { + "description": "The content html value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_agent": { + "description": "The is agent value.", + "type": "boolean" + }, + "is_private": { + "description": "The is private value.", + "type": "boolean" + }, + "item_id": { + "description": "The item id value.", + "type": "integer" + }, + "portal_customer_id": { + "description": "The portal customer id value.", + "nullable": true, + "type": "integer" + }, + "reactions": { + "description": "The reactions value.", "items": { "additionalProperties": false, "properties": { - "applies_to_customer_organisations": { - "description": "The applies to customer organisations value.", - "type": "boolean" - }, - "applies_to_portal_customers": { - "description": "The applies to portal customers value.", - "type": "boolean" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "display_order": { - "description": "The display order value.", + "count": { + "description": "The count value.", "type": "integer" }, - "field_type": { - "description": "The field type value.", - "type": "string" - }, - "name": { - "description": "The name value.", + "reaction": { + "description": "The reaction value.", "type": "string" }, - "options": { - "description": "The options value.", - "type": "string" + "user_ids": { + "description": "The user ids value.", + "items": { + "type": "integer" + }, + "type": "array" }, - "required": { - "description": "The required value.", - "type": "boolean" - } - }, - "required": [ - "display_order", - "field_type", - "name", - "required" - ], - "type": "object" - }, - "type": "array" - }, - "item_types": { - "description": "The item types value.", - "items": { - "additionalProperties": false, - "properties": { - "color": { - "description": "The color value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "hierarchy_level": { - "description": "The hierarchy level value.", - "type": "integer" - }, - "icon": { - "description": "The icon value.", - "type": "string" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "sort_order": { - "description": "The sort order value.", - "type": "integer" - } - }, - "required": [ - "hierarchy_level", - "name", - "sort_order" - ], - "type": "object" - }, - "type": "array" - }, - "link_types": { - "description": "The link types value.", - "items": { - "additionalProperties": false, - "properties": { - "allowed_entity_types": { - "description": "The allowed entity types value.", + "user_names": { + "description": "The user names value.", "items": { "type": "string" }, "type": "array" - }, - "color": { - "description": "The color value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "forward_label": { - "description": "The forward label value.", - "type": "string" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "reverse_label": { - "description": "The reverse label value.", - "type": "string" } }, "required": [ - "forward_label", - "name", - "reverse_label" + "count", + "reaction", + "user_ids", + "user_names" ], "type": "object" }, "type": "array" }, - "priorities": { - "description": "The priorities value.", + "source": { + "description": "The source value.", + "type": "string" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "content", + "created_at", + "id", + "is_private", + "item_id", + "source", + "updated_at" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetConditionSetsConditionSetIdResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "gated_transitions": { + "description": "The gated transitions value.", "items": { "additionalProperties": false, "properties": { - "color": { - "description": "The color value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" + "from_all_statuses": { + "description": "The from all statuses value.", + "type": "boolean" }, - "icon": { - "description": "The icon value.", + "from_status_name": { + "description": "The from status name value.", "type": "string" }, - "name": { - "description": "The name value.", + "to_status_name": { + "description": "The to status name value.", "type": "string" }, - "sort_order": { - "description": "The sort order value.", + "transition_id": { + "description": "The transition id value.", "type": "integer" } }, "required": [ - "name", - "sort_order" + "to_status_name", + "transition_id" ], "type": "object" }, "type": "array" }, - "screens": { - "description": "The screens value.", + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "transition_conditions": { + "description": "The transition conditions value.", "items": { "additionalProperties": false, "properties": { - "description": { - "description": "The description value.", - "type": "string" + "condition_set_id": { + "description": "The condition set id value.", + "type": "integer" }, - "fields": { - "description": "The fields value.", + "conditions": { + "description": "The conditions value.", "items": { "additionalProperties": false, "properties": { - "custom_field_name": { - "description": "The custom field name value.", + "condition_set_transition_id": { + "description": "The condition set transition id value.", + "type": "integer" + }, + "condition_type": { + "description": "The condition type value.", + "type": "string" + }, + "config": { + "description": "The config value.", + "format": "byte", "type": "string" }, "display_order": { "description": "The display order value.", "type": "integer" }, - "field_identifier": { - "description": "The field identifier value.", + "error_message": { + "description": "The error message value.", "type": "string" }, - "field_kind": { - "description": "The field kind value.", - "type": "string" + "id": { + "description": "The id value.", + "type": "integer" }, - "field_width": { - "description": "The field width value.", + "mode": { + "description": "The mode value.", "type": "string" - }, - "is_required": { - "description": "The is required value.", - "type": "boolean" } }, "required": [ + "condition_set_transition_id", + "condition_type", + "config", "display_order", - "field_kind" + "id", + "mode" ], "type": "object" }, "type": "array" }, - "name": { - "description": "The name value.", - "type": "string" - }, - "system_fields": { - "description": "The system fields value.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "fields", - "name" - ], - "type": "object" - }, - "type": "array" - }, - "status_categories": { - "description": "The status categories value.", - "items": { - "additionalProperties": false, - "properties": { - "name": { - "description": "The name value.", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - }, - "statuses": { - "description": "The statuses value.", - "items": { - "additionalProperties": false, - "properties": { - "category_name": { - "description": "The category name value.", + "from_status_name": { + "description": "The from status name value.", "type": "string" }, - "description": { - "description": "The description value.", - "type": "string" + "id": { + "description": "The id value.", + "type": "integer" }, - "name": { - "description": "The name value.", - "type": "string" - } - }, - "required": [ - "category_name", - "name" - ], - "type": "object" - }, - "type": "array" - }, - "workflows": { - "description": "The workflows value.", - "items": { - "additionalProperties": false, - "properties": { - "description": { - "description": "The description value.", + "logic_mode": { + "description": "The logic mode value.", "type": "string" }, - "name": { - "description": "The name value.", + "to_status_name": { + "description": "The to status name value.", "type": "string" }, - "transitions": { - "description": "The transitions value.", - "items": { - "additionalProperties": false, - "properties": { - "display_order": { - "description": "The display order value.", - "type": "integer" - }, - "from_all_statuses": { - "description": "The from all statuses value.", - "type": "boolean" - }, - "from_status_name": { - "description": "The from status name value.", - "nullable": true, - "type": "string" - }, - "source_handle": { - "description": "The source handle value.", - "type": "string" - }, - "target_handle": { - "description": "The target handle value.", - "type": "string" - }, - "to_status_name": { - "description": "The to status name value.", - "type": "string" - } - }, - "required": [ - "to_status_name" - ], - "type": "object" - }, - "type": "array" + "transition_id": { + "description": "The transition id value.", + "type": "integer" } }, "required": [ - "name" + "condition_set_id", + "id", + "logic_mode", + "transition_id" ], "type": "object" }, "type": "array" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "workflow_id": { + "description": "The workflow id value.", + "type": "integer" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" } }, "required": [ - "configuration_set", - "configuration_set_links" + "created_at", + "description", + "id", + "name", + "updated_at", + "workflow_id" ], "type": "object" - }, - "schema_version": { - "description": "The schema version value.", - "type": "integer" } }, "required": [ - "exported_at", - "kind", - "payload", - "schema_version" + "data" ], "type": "object" }, - "GetConfigurationSetsConfigurationSetIdResult": { + "GetConditionSetsResult": { "additionalProperties": false, "properties": { "data": { - "additionalProperties": false, - "properties": { - "approval_set_id": { - "description": "The approval set id value.", - "nullable": true, - "type": "integer" - }, - "approval_set_name": { - "description": "The approval set name value.", - "type": "string" - }, - "builtin_key": { - "description": "The builtin key value.", - "type": "string" - }, - "condition_set_id": { - "description": "The condition set id value.", - "nullable": true, - "type": "integer" - }, - "condition_set_name": { - "description": "The condition set name value.", - "type": "string" - }, - "create_screen_builtin_key": { - "description": "The create screen builtin key value.", - "type": "string" - }, - "create_screen_id": { - "description": "The create screen id value.", - "nullable": true, - "type": "integer" - }, - "create_screen_name": { - "description": "The create screen name value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "default_item_type_builtin_key": { - "description": "The default item type builtin key value.", - "type": "string" - }, - "default_item_type_id": { - "description": "The default item type id value.", - "nullable": true, - "type": "integer" - }, - "default_item_type_name": { - "description": "The default item type name value.", - "type": "string" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "differentiate_by_item_type": { - "description": "The differentiate by item type value.", - "type": "boolean" - }, - "display_description": { - "description": "The display description value.", - "type": "string" - }, - "display_name": { - "description": "The display name value.", - "type": "string" - }, - "edit_screen_builtin_key": { - "description": "The edit screen builtin key value.", - "type": "string" - }, - "edit_screen_id": { - "description": "The edit screen id value.", - "nullable": true, - "type": "integer" - }, - "edit_screen_name": { - "description": "The edit screen name value.", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_default": { - "description": "The is default value.", - "type": "boolean" - }, - "item_type_configs": { - "description": "The item type configs value.", - "items": { - "additionalProperties": false, - "properties": { - "approval_set_id": { - "description": "The approval set id value.", - "nullable": true, - "type": "integer" - }, - "approval_set_name": { - "description": "The approval set name value.", - "type": "string" + "items": { + "additionalProperties": false, + "properties": { + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "gated_transitions": { + "description": "The gated transitions value.", + "items": { + "additionalProperties": false, + "properties": { + "from_all_statuses": { + "description": "The from all statuses value.", + "type": "boolean" + }, + "from_status_name": { + "description": "The from status name value.", + "type": "string" + }, + "to_status_name": { + "description": "The to status name value.", + "type": "string" + }, + "transition_id": { + "description": "The transition id value.", + "type": "integer" + } }, - "condition_set_id": { - "description": "The condition set id value.", - "nullable": true, - "type": "integer" - }, - "condition_set_name": { - "description": "The condition set name value.", - "type": "string" - }, - "create_screen_builtin_key": { - "description": "The create screen builtin key value.", - "type": "string" - }, - "create_screen_id": { - "description": "The create screen id value.", - "nullable": true, - "type": "integer" - }, - "create_screen_name": { - "description": "The create screen name value.", - "type": "string" - }, - "edit_screen_builtin_key": { - "description": "The edit screen builtin key value.", - "type": "string" - }, - "edit_screen_id": { - "description": "The edit screen id value.", - "nullable": true, - "type": "integer" - }, - "edit_screen_name": { - "description": "The edit screen name value.", - "type": "string" - }, - "hierarchy_level": { - "description": "The hierarchy level value.", - "type": "integer" - }, - "item_type_builtin_key": { - "description": "The item type builtin key value.", - "type": "string" - }, - "item_type_color": { - "description": "The item type color value.", - "type": "string" - }, - "item_type_icon": { - "description": "The item type icon value.", - "type": "string" - }, - "item_type_id": { - "description": "The item type id value.", - "type": "integer" - }, - "item_type_name": { - "description": "The item type name value.", - "type": "string" - }, - "view_screen_builtin_key": { - "description": "The view screen builtin key value.", - "type": "string" - }, - "view_screen_id": { - "description": "The view screen id value.", - "nullable": true, - "type": "integer" - }, - "view_screen_name": { - "description": "The view screen name value.", - "type": "string" - }, - "workflow_builtin_key": { - "description": "The workflow builtin key value.", - "type": "string" - }, - "workflow_id": { - "description": "The workflow id value.", - "nullable": true, - "type": "integer" + "required": [ + "to_status_name", + "transition_id" + ], + "type": "object" + }, + "type": "array" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "transition_conditions": { + "description": "The transition conditions value.", + "items": { + "additionalProperties": false, + "properties": { + "condition_set_id": { + "description": "The condition set id value.", + "type": "integer" + }, + "conditions": { + "description": "The conditions value.", + "items": { + "additionalProperties": false, + "properties": { + "condition_set_transition_id": { + "description": "The condition set transition id value.", + "type": "integer" + }, + "condition_type": { + "description": "The condition type value.", + "type": "string" + }, + "config": { + "description": "The config value.", + "format": "byte", + "type": "string" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "error_message": { + "description": "The error message value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "mode": { + "description": "The mode value.", + "type": "string" + } + }, + "required": [ + "condition_set_transition_id", + "condition_type", + "config", + "display_order", + "id", + "mode" + ], + "type": "object" + }, + "type": "array" + }, + "from_status_name": { + "description": "The from status name value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "logic_mode": { + "description": "The logic mode value.", + "type": "string" + }, + "to_status_name": { + "description": "The to status name value.", + "type": "string" + }, + "transition_id": { + "description": "The transition id value.", + "type": "integer" + } }, - "workflow_name": { - "description": "The workflow name value.", - "type": "string" - } + "required": [ + "condition_set_id", + "id", + "logic_mode", + "transition_id" + ], + "type": "object" }, - "required": [ - "hierarchy_level", - "item_type_color", - "item_type_icon", - "item_type_id", - "item_type_name" - ], - "type": "object" + "type": "array" }, - "type": "array" - }, - "item_types": { - "description": "The item types value.", - "items": { + "updated_at": { + "description": "The updated at value.", + "format": "date-time", "type": "string" }, - "type": "array" + "workflow_id": { + "description": "The workflow id value.", + "type": "integer" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" + } }, - "item_types_detailed": { - "description": "The item types detailed value.", + "required": [ + "created_at", + "description", + "id", + "name", + "updated_at", + "workflow_id" + ], + "type": "object" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "type": "object" + }, + "GetConfigurationSetsConfigurationSetIdExportResult": { + "additionalProperties": false, + "nullable": true, + "properties": { + "exported_at": { + "description": "The exported at value.", + "format": "date-time", + "type": "string" + }, + "exported_by": { + "additionalProperties": false, + "description": "The exported by value.", + "nullable": true, + "properties": { + "instance": { + "description": "The instance value.", + "type": "string" + }, + "username": { + "description": "The username value.", + "type": "string" + } + }, + "type": "object" + }, + "kind": { + "description": "The kind value.", + "type": "string" + }, + "payload": { + "additionalProperties": false, + "description": "The payload value.", + "properties": { + "approval_sets": { + "description": "The approval sets value.", "items": { "additionalProperties": false, "properties": { - "builtin_key": { - "description": "The builtin key value.", + "description": { + "description": "The description value.", "type": "string" }, - "color": { - "description": "The color value.", + "name": { + "description": "The name value.", "type": "string" }, - "hierarchy_level": { - "description": "The hierarchy level value.", - "type": "integer" - }, - "icon": { - "description": "The icon value.", - "type": "string" + "set_statuses": { + "description": "The set statuses value.", + "items": { + "additionalProperties": false, + "properties": { + "approve_transition": { + "additionalProperties": false, + "description": "The approve transition value.", + "properties": { + "from_all_statuses": { + "description": "The from all statuses value.", + "type": "boolean" + }, + "from_status_name": { + "description": "The from status name value.", + "nullable": true, + "type": "string" + }, + "to_status_name": { + "description": "The to status name value.", + "type": "string" + } + }, + "required": [ + "to_status_name" + ], + "type": "object" + }, + "deny_transition": { + "additionalProperties": false, + "description": "The deny transition value.", + "properties": { + "from_all_statuses": { + "description": "The from all statuses value.", + "type": "boolean" + }, + "from_status_name": { + "description": "The from status name value.", + "nullable": true, + "type": "string" + }, + "to_status_name": { + "description": "The to status name value.", + "type": "string" + } + }, + "required": [ + "to_status_name" + ], + "type": "object" + }, + "status_name": { + "description": "The status name value.", + "type": "string" + }, + "step_mode": { + "description": "The step mode value.", + "type": "string" + }, + "steps": { + "description": "The steps value.", + "items": { + "additionalProperties": false, + "properties": { + "allow_self_approval": { + "description": "The allow self approval value.", + "type": "boolean" + }, + "approver_custom_field_name": { + "description": "The approver custom field name value.", + "type": "string" + }, + "approver_field_identifier": { + "description": "The approver field identifier value.", + "type": "string" + }, + "approver_group_name": { + "description": "The approver group name value.", + "type": "string" + }, + "approver_role_name": { + "description": "The approver role name value.", + "type": "string" + }, + "approver_source": { + "description": "The approver source value.", + "type": "string" + }, + "approver_user_email": { + "description": "The approver user email value.", + "type": "string" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "escalation_action": { + "description": "The escalation action value.", + "type": "string" + }, + "escalation_after_hours": { + "description": "The escalation after hours value.", + "nullable": true, + "type": "integer" + }, + "escalation_target_custom_field_name": { + "description": "The escalation target custom field name value.", + "type": "string" + }, + "escalation_target_field_identifier": { + "description": "The escalation target field identifier value.", + "type": "string" + }, + "escalation_target_group_name": { + "description": "The escalation target group name value.", + "type": "string" + }, + "escalation_target_role_name": { + "description": "The escalation target role name value.", + "type": "string" + }, + "escalation_target_source": { + "description": "The escalation target source value.", + "type": "string" + }, + "escalation_target_user_email": { + "description": "The escalation target user email value.", + "type": "string" + }, + "max_escalations": { + "description": "The max escalations value.", + "nullable": true, + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "on_leave_strategy": { + "description": "The on leave strategy value.", + "type": "string" + }, + "quorum_count": { + "description": "The quorum count value.", + "nullable": true, + "type": "integer" + }, + "quorum_mode": { + "description": "The quorum mode value.", + "type": "string" + }, + "quorum_percent": { + "description": "The quorum percent value.", + "nullable": true, + "type": "integer" + }, + "rejection_policy": { + "description": "The rejection policy value.", + "type": "string" + } + }, + "required": [ + "approver_source", + "display_order", + "on_leave_strategy", + "quorum_mode", + "rejection_policy" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "approve_transition", + "deny_transition", + "status_name", + "step_mode" + ], + "type": "object" + }, + "type": "array" }, - "name": { - "description": "The name value.", + "workflow_name": { + "description": "The workflow name value.", "type": "string" } }, "required": [ - "color", - "hierarchy_level", - "icon", - "name" + "name", + "workflow_name" ], "type": "object" }, "type": "array" }, - "name": { - "description": "The name value.", - "type": "string" - }, - "notification_setting_builtin_key": { - "description": "The notification setting builtin key value.", - "type": "string" - }, - "notification_setting_id": { - "description": "The notification setting id value.", - "nullable": true, - "type": "integer" - }, - "notification_setting_name": { - "description": "The notification setting name value.", - "type": "string" - }, - "priorities_detailed": { - "description": "The priorities detailed value.", + "condition_sets": { + "description": "The condition sets value.", "items": { "additionalProperties": false, "properties": { - "builtin_key": { - "description": "The builtin key value.", - "type": "string" - }, - "color": { - "description": "The color value.", - "type": "string" - }, - "icon": { - "description": "The icon value.", + "description": { + "description": "The description value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "transition_conditions": { + "description": "The transition conditions value.", + "items": { + "additionalProperties": false, + "properties": { + "conditions": { + "description": "The conditions value.", + "items": { + "additionalProperties": false, + "properties": { + "config": { + "additionalProperties": { + "description": "Arbitrary JSON extension value." + }, + "description": "The config value.", + "type": "object" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "error_message": { + "description": "The error message value.", + "type": "string" + }, + "mode": { + "description": "The mode value.", + "type": "string" + }, + "type": { + "description": "The type value.", + "type": "string" + } + }, + "required": [ + "config", + "mode", + "type" + ], + "type": "object" + }, + "type": "array" + }, + "from_all_statuses": { + "description": "The from all statuses value.", + "type": "boolean" + }, + "from_status_name": { + "description": "The from status name value.", + "nullable": true, + "type": "string" + }, + "logic_mode": { + "description": "The logic mode value.", + "type": "string" + }, + "to_status_name": { + "description": "The to status name value.", + "type": "string" + } + }, + "required": [ + "logic_mode", + "to_status_name" + ], + "type": "object" + }, + "type": "array" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" + } + }, + "required": [ + "name", + "workflow_name" + ], + "type": "object" + }, + "type": "array" + }, + "configuration_set": { + "additionalProperties": false, + "description": "The configuration set value.", + "properties": { + "default_item_type_name": { + "description": "The default item type name value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "differentiate_by_item_type": { + "description": "The differentiate by item type value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "configuration_set_links": { + "additionalProperties": false, + "description": "The configuration set links value.", + "properties": { + "approval_set_name": { + "description": "The approval set name value.", + "type": "string" + }, + "condition_set_name": { + "description": "The condition set name value.", + "type": "string" + }, + "create_screen_name": { + "description": "The create screen name value.", + "type": "string" + }, + "edit_screen_name": { + "description": "The edit screen name value.", + "type": "string" + }, + "item_type_configs": { + "description": "The item type configs value.", + "items": { + "additionalProperties": false, + "properties": { + "approval_set_name": { + "description": "The approval set name value.", + "type": "string" + }, + "condition_set_name": { + "description": "The condition set name value.", + "type": "string" + }, + "create_screen_name": { + "description": "The create screen name value.", + "type": "string" + }, + "edit_screen_name": { + "description": "The edit screen name value.", + "type": "string" + }, + "item_type_name": { + "description": "The item type name value.", + "type": "string" + }, + "view_screen_name": { + "description": "The view screen name value.", + "type": "string" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" + } + }, + "required": [ + "item_type_name" + ], + "type": "object" + }, + "type": "array" + }, + "priority_names": { + "description": "The priority names value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "view_screen_name": { + "description": "The view screen name value.", + "type": "string" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" + } + }, + "type": "object" + }, + "custom_fields": { + "description": "The custom fields value.", + "items": { + "additionalProperties": false, + "properties": { + "applies_to_customer_organisations": { + "description": "The applies to customer organisations value.", + "type": "boolean" + }, + "applies_to_portal_customers": { + "description": "The applies to portal customers value.", + "type": "boolean" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "field_type": { + "description": "The field type value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "options": { + "description": "The options value.", + "type": "string" + }, + "required": { + "description": "The required value.", + "type": "boolean" + } + }, + "required": [ + "display_order", + "field_type", + "name", + "required" + ], + "type": "object" + }, + "type": "array" + }, + "item_types": { + "description": "The item types value.", + "items": { + "additionalProperties": false, + "properties": { + "color": { + "description": "The color value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "hierarchy_level": { + "description": "The hierarchy level value.", + "type": "integer" + }, + "icon": { + "description": "The icon value.", "type": "string" }, - "id": { - "description": "The id value.", - "type": "integer" - }, "name": { "description": "The name value.", "type": "string" @@ -9077,9 +9527,7 @@ } }, "required": [ - "color", - "icon", - "id", + "hierarchy_level", "name", "sort_order" ], @@ -9087,95 +9535,668 @@ }, "type": "array" }, - "priority_ids": { - "description": "The priority ids value.", + "link_types": { + "description": "The link types value.", "items": { - "type": "integer" + "additionalProperties": false, + "properties": { + "allowed_entity_types": { + "description": "The allowed entity types value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "color": { + "description": "The color value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "forward_label": { + "description": "The forward label value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "reverse_label": { + "description": "The reverse label value.", + "type": "string" + } + }, + "required": [ + "forward_label", + "name", + "reverse_label" + ], + "type": "object" }, "type": "array" }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "view_screen_builtin_key": { - "description": "The view screen builtin key value.", - "type": "string" - }, - "view_screen_id": { - "description": "The view screen id value.", - "nullable": true, - "type": "integer" - }, - "view_screen_name": { - "description": "The view screen name value.", - "type": "string" - }, - "workflow_builtin_key": { - "description": "The workflow builtin key value.", - "type": "string" - }, - "workflow_id": { - "description": "The workflow id value.", - "nullable": true, - "type": "integer" - }, - "workflow_name": { - "description": "The workflow name value.", - "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "type": "integer" + "priorities": { + "description": "The priorities value.", + "items": { + "additionalProperties": false, + "properties": { + "color": { + "description": "The color value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "icon": { + "description": "The icon value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "sort_order": { + "description": "The sort order value.", + "type": "integer" + } + }, + "required": [ + "name", + "sort_order" + ], + "type": "object" + }, + "type": "array" }, - "workspace_ids": { - "description": "The workspace ids value.", + "screens": { + "description": "The screens value.", "items": { - "type": "integer" + "additionalProperties": false, + "properties": { + "description": { + "description": "The description value.", + "type": "string" + }, + "fields": { + "description": "The fields value.", + "items": { + "additionalProperties": false, + "properties": { + "custom_field_name": { + "description": "The custom field name value.", + "type": "string" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "field_identifier": { + "description": "The field identifier value.", + "type": "string" + }, + "field_kind": { + "description": "The field kind value.", + "type": "string" + }, + "field_width": { + "description": "The field width value.", + "type": "string" + }, + "is_required": { + "description": "The is required value.", + "type": "boolean" + } + }, + "required": [ + "display_order", + "field_kind" + ], + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "system_fields": { + "description": "The system fields value.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "fields", + "name" + ], + "type": "object" }, "type": "array" }, - "workspace_name": { - "description": "The workspace name value.", - "type": "string" + "status_categories": { + "description": "The status categories value.", + "items": { + "additionalProperties": false, + "properties": { + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" }, - "workspaces": { - "description": "The workspaces value.", + "statuses": { + "description": "The statuses value.", "items": { - "type": "string" + "additionalProperties": false, + "properties": { + "category_name": { + "description": "The category name value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "category_name", + "name" + ], + "type": "object" }, "type": "array" - } - }, - "required": [ - "created_at", - "description", - "differentiate_by_item_type", - "display_name", - "id", - "is_default", - "name", - "updated_at", - "workspace_id" - ], - "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "GetConfigurationSetsResult": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "additionalProperties": false, - "properties": { - "approval_set_id": { - "description": "The approval set id value.", + }, + "workflows": { + "description": "The workflows value.", + "items": { + "additionalProperties": false, + "properties": { + "description": { + "description": "The description value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "transitions": { + "description": "The transitions value.", + "items": { + "additionalProperties": false, + "properties": { + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "from_all_statuses": { + "description": "The from all statuses value.", + "type": "boolean" + }, + "from_status_name": { + "description": "The from status name value.", + "nullable": true, + "type": "string" + }, + "source_handle": { + "description": "The source handle value.", + "type": "string" + }, + "target_handle": { + "description": "The target handle value.", + "type": "string" + }, + "to_status_name": { + "description": "The to status name value.", + "type": "string" + } + }, + "required": [ + "to_status_name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "configuration_set", + "configuration_set_links" + ], + "type": "object" + }, + "schema_version": { + "description": "The schema version value.", + "type": "integer" + } + }, + "required": [ + "exported_at", + "kind", + "payload", + "schema_version" + ], + "type": "object" + }, + "GetConfigurationSetsConfigurationSetIdResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "approval_set_id": { + "description": "The approval set id value.", + "nullable": true, + "type": "integer" + }, + "approval_set_name": { + "description": "The approval set name value.", + "type": "string" + }, + "builtin_key": { + "description": "The builtin key value.", + "type": "string" + }, + "condition_set_id": { + "description": "The condition set id value.", + "nullable": true, + "type": "integer" + }, + "condition_set_name": { + "description": "The condition set name value.", + "type": "string" + }, + "create_screen_builtin_key": { + "description": "The create screen builtin key value.", + "type": "string" + }, + "create_screen_id": { + "description": "The create screen id value.", + "nullable": true, + "type": "integer" + }, + "create_screen_name": { + "description": "The create screen name value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "default_item_type_builtin_key": { + "description": "The default item type builtin key value.", + "type": "string" + }, + "default_item_type_id": { + "description": "The default item type id value.", + "nullable": true, + "type": "integer" + }, + "default_item_type_name": { + "description": "The default item type name value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "differentiate_by_item_type": { + "description": "The differentiate by item type value.", + "type": "boolean" + }, + "display_description": { + "description": "The display description value.", + "type": "string" + }, + "display_name": { + "description": "The display name value.", + "type": "string" + }, + "edit_screen_builtin_key": { + "description": "The edit screen builtin key value.", + "type": "string" + }, + "edit_screen_id": { + "description": "The edit screen id value.", + "nullable": true, + "type": "integer" + }, + "edit_screen_name": { + "description": "The edit screen name value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_default": { + "description": "The is default value.", + "type": "boolean" + }, + "item_type_configs": { + "description": "The item type configs value.", + "items": { + "additionalProperties": false, + "properties": { + "approval_set_id": { + "description": "The approval set id value.", + "nullable": true, + "type": "integer" + }, + "approval_set_name": { + "description": "The approval set name value.", + "type": "string" + }, + "condition_set_id": { + "description": "The condition set id value.", + "nullable": true, + "type": "integer" + }, + "condition_set_name": { + "description": "The condition set name value.", + "type": "string" + }, + "create_screen_builtin_key": { + "description": "The create screen builtin key value.", + "type": "string" + }, + "create_screen_id": { + "description": "The create screen id value.", + "nullable": true, + "type": "integer" + }, + "create_screen_name": { + "description": "The create screen name value.", + "type": "string" + }, + "edit_screen_builtin_key": { + "description": "The edit screen builtin key value.", + "type": "string" + }, + "edit_screen_id": { + "description": "The edit screen id value.", + "nullable": true, + "type": "integer" + }, + "edit_screen_name": { + "description": "The edit screen name value.", + "type": "string" + }, + "hierarchy_level": { + "description": "The hierarchy level value.", + "type": "integer" + }, + "item_type_builtin_key": { + "description": "The item type builtin key value.", + "type": "string" + }, + "item_type_color": { + "description": "The item type color value.", + "type": "string" + }, + "item_type_icon": { + "description": "The item type icon value.", + "type": "string" + }, + "item_type_id": { + "description": "The item type id value.", + "type": "integer" + }, + "item_type_name": { + "description": "The item type name value.", + "type": "string" + }, + "view_screen_builtin_key": { + "description": "The view screen builtin key value.", + "type": "string" + }, + "view_screen_id": { + "description": "The view screen id value.", + "nullable": true, + "type": "integer" + }, + "view_screen_name": { + "description": "The view screen name value.", + "type": "string" + }, + "workflow_builtin_key": { + "description": "The workflow builtin key value.", + "type": "string" + }, + "workflow_id": { + "description": "The workflow id value.", + "nullable": true, + "type": "integer" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" + } + }, + "required": [ + "hierarchy_level", + "item_type_color", + "item_type_icon", + "item_type_id", + "item_type_name" + ], + "type": "object" + }, + "type": "array" + }, + "item_types": { + "description": "The item types value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "item_types_detailed": { + "description": "The item types detailed value.", + "items": { + "additionalProperties": false, + "properties": { + "builtin_key": { + "description": "The builtin key value.", + "type": "string" + }, + "color": { + "description": "The color value.", + "type": "string" + }, + "hierarchy_level": { + "description": "The hierarchy level value.", + "type": "integer" + }, + "icon": { + "description": "The icon value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "color", + "hierarchy_level", + "icon", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "notification_setting_builtin_key": { + "description": "The notification setting builtin key value.", + "type": "string" + }, + "notification_setting_id": { + "description": "The notification setting id value.", + "nullable": true, + "type": "integer" + }, + "notification_setting_name": { + "description": "The notification setting name value.", + "type": "string" + }, + "priorities_detailed": { + "description": "The priorities detailed value.", + "items": { + "additionalProperties": false, + "properties": { + "builtin_key": { + "description": "The builtin key value.", + "type": "string" + }, + "color": { + "description": "The color value.", + "type": "string" + }, + "icon": { + "description": "The icon value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "sort_order": { + "description": "The sort order value.", + "type": "integer" + } + }, + "required": [ + "color", + "icon", + "id", + "name", + "sort_order" + ], + "type": "object" + }, + "type": "array" + }, + "priority_ids": { + "description": "The priority ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "view_screen_builtin_key": { + "description": "The view screen builtin key value.", + "type": "string" + }, + "view_screen_id": { + "description": "The view screen id value.", + "nullable": true, + "type": "integer" + }, + "view_screen_name": { + "description": "The view screen name value.", + "type": "string" + }, + "workflow_builtin_key": { + "description": "The workflow builtin key value.", + "type": "string" + }, + "workflow_id": { + "description": "The workflow id value.", + "nullable": true, + "type": "integer" + }, + "workflow_name": { + "description": "The workflow name value.", + "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "type": "integer" + }, + "workspace_ids": { + "description": "The workspace ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "workspace_name": { + "description": "The workspace name value.", + "type": "string" + }, + "workspaces": { + "description": "The workspaces value.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "created_at", + "description", + "differentiate_by_item_type", + "display_name", + "id", + "is_default", + "name", + "updated_at", + "workspace_id" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "GetConfigurationSetsResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "approval_set_id": { + "description": "The approval set id value.", "nullable": true, "type": "integer" }, @@ -55160,6 +56181,18 @@ "data": { "additionalProperties": false, "properties": { + "board_enabled": { + "description": "The board enabled value.", + "type": "boolean" + }, + "board_ever_published": { + "description": "The board ever published value.", + "type": "boolean" + }, + "board_standalone_enabled": { + "description": "The board standalone enabled value.", + "type": "boolean" + }, "category_color": { "description": "The category color value.", "type": "string" @@ -55219,6 +56252,20 @@ "description": "The public milestone swimlanes value.", "type": "boolean" }, + "public_revoke_reason": { + "description": "The public revoke reason value.", + "type": "string" + }, + "public_revoked_at": { + "description": "The public revoked at value.", + "nullable": true, + "type": "string" + }, + "public_revoked_by": { + "description": "The public revoked by value.", + "nullable": true, + "type": "integer" + }, "public_slug": { "description": "The public slug value.", "nullable": true, @@ -55228,6 +56275,20 @@ "description": "The ql query value.", "type": "string" }, + "sharing_changed_at": { + "description": "The sharing changed at value.", + "nullable": true, + "type": "string" + }, + "sharing_changed_by": { + "description": "The sharing changed by value.", + "nullable": true, + "type": "integer" + }, + "sharing_revision": { + "description": "The sharing revision value.", + "type": "integer" + }, "updated_at": { "description": "The updated at value.", "type": "string" @@ -55239,6 +56300,9 @@ } }, "required": [ + "board_enabled", + "board_ever_published", + "board_standalone_enabled", "created_at", "description", "id", @@ -55246,7 +56310,9 @@ "is_public", "name", "public_milestone_swimlanes", + "public_revoke_reason", "ql_query", + "sharing_revision", "updated_at" ], "type": "object" @@ -55284,6 +56350,18 @@ "data": { "additionalProperties": false, "properties": { + "board_enabled": { + "description": "The board enabled value.", + "type": "boolean" + }, + "board_ever_published": { + "description": "The board ever published value.", + "type": "boolean" + }, + "board_standalone_enabled": { + "description": "The board standalone enabled value.", + "type": "boolean" + }, "category_color": { "description": "The category color value.", "type": "string" @@ -55343,6 +56421,20 @@ "description": "The public milestone swimlanes value.", "type": "boolean" }, + "public_revoke_reason": { + "description": "The public revoke reason value.", + "type": "string" + }, + "public_revoked_at": { + "description": "The public revoked at value.", + "nullable": true, + "type": "string" + }, + "public_revoked_by": { + "description": "The public revoked by value.", + "nullable": true, + "type": "integer" + }, "public_slug": { "description": "The public slug value.", "nullable": true, @@ -55352,6 +56444,20 @@ "description": "The ql query value.", "type": "string" }, + "sharing_changed_at": { + "description": "The sharing changed at value.", + "nullable": true, + "type": "string" + }, + "sharing_changed_by": { + "description": "The sharing changed by value.", + "nullable": true, + "type": "integer" + }, + "sharing_revision": { + "description": "The sharing revision value.", + "type": "integer" + }, "updated_at": { "description": "The updated at value.", "type": "string" @@ -55363,6 +56469,9 @@ } }, "required": [ + "board_enabled", + "board_ever_published", + "board_standalone_enabled", "created_at", "description", "id", @@ -55370,7 +56479,9 @@ "is_public", "name", "public_milestone_swimlanes", + "public_revoke_reason", "ql_query", + "sharing_revision", "updated_at" ], "type": "object" @@ -67850,86 +68961,240 @@ ], "type": "object" }, - "PostCollectionCategoriesPayload": { + "PostBoardPublicationsCollectionIdAllowRepublishPayload": { "additionalProperties": false, "properties": { - "color": { - "description": "The color value.", - "type": "string" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "description": { - "description": "The description value.", + "reason": { + "description": "The reason value.", "type": "string" }, - "id": { - "description": "The id value.", + "revision": { + "description": "The revision value.", "type": "integer" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" } }, "required": [ - "color", - "created_at", - "description", - "id", - "name", - "updated_at" + "reason", + "revision" ], "type": "object" }, - "PostCollectionCategoriesResult": { + "PostBoardPublicationsCollectionIdAllowRepublishResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, + "nullable": true, "properties": { - "color": { - "description": "The color value.", - "type": "string" + "can_administer": { + "description": "The can administer value.", + "type": "boolean" }, - "created_at": { - "description": "The created at value.", - "format": "date-time", + "changed_at": { + "description": "The changed at value.", + "nullable": true, "type": "string" }, - "description": { - "description": "The description value.", + "changed_by": { + "description": "The changed by value.", + "nullable": true, + "type": "integer" + }, + "changed_by_name": { + "description": "The changed by name value.", "type": "string" }, - "id": { - "description": "The id value.", + "collection_id": { + "description": "The collection id value.", "type": "integer" }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "instance_enabled": { + "description": "The instance enabled value.", + "type": "boolean" + }, + "locations": { + "description": "The locations value.", + "items": { + "additionalProperties": false, + "properties": { + "channel_id": { + "description": "The channel id value.", + "nullable": true, + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "kind": { + "description": "The kind value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "url": { + "description": "The url value.", + "type": "string" + } + }, + "required": [ + "effective_policy", + "enabled", + "kind", + "label", + "url" + ], + "type": "object" + }, + "type": "array" + }, + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" + }, "name": { "description": "The name value.", "type": "string" }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", + "organisations": { + "description": "The organisations value.", + "items": { + "additionalProperties": false, + "properties": { + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "owner_active": { + "description": "The owner active value.", + "nullable": true, + "type": "boolean" + }, + "owner_id": { + "description": "The owner id value.", + "nullable": true, + "type": "integer" + }, + "owner_name": { + "description": "The owner name value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "revoke_reason": { + "description": "The revoke reason value.", + "type": "string" + }, + "revoked_at": { + "description": "The revoked at value.", + "nullable": true, + "type": "string" + }, + "scope": { + "description": "The scope value.", + "type": "string" + }, + "slug": { + "description": "The slug value.", + "nullable": true, + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + }, + "workspace_name": { + "description": "The workspace name value.", "type": "string" } }, "required": [ - "color", - "created_at", - "description", - "id", + "can_administer", + "changed_by_name", + "collection_id", + "enabled", + "instance_enabled", + "locations", + "milestone_swimlanes", "name", - "updated_at" + "organisations", + "owner_name", + "policy", + "revision", + "revoke_reason", + "scope", + "standalone_enabled", + "workspace_name" ], "type": "object" } @@ -67939,80 +69204,240 @@ ], "type": "object" }, - "PostCollectionsCollectionIdQueuesPayload": { + "PostBoardPublicationsCollectionIdRevokePayload": { "additionalProperties": false, "properties": { - "filter_state": { - "description": "The filter state value.", - "nullable": true, - "type": "string" - }, - "name": { - "description": "The name value.", + "reason": { + "description": "The reason value.", "type": "string" }, - "ql_query": { - "description": "The ql query value.", - "type": "string" + "revision": { + "description": "The revision value.", + "type": "integer" } }, "required": [ - "name", - "ql_query" + "reason", + "revision" ], "type": "object" }, - "PostCollectionsCollectionIdQueuesResult": { + "PostBoardPublicationsCollectionIdRevokeResult": { "additionalProperties": false, "properties": { "data": { "additionalProperties": false, + "nullable": true, "properties": { - "builtin": { - "description": "The builtin value.", + "can_administer": { + "description": "The can administer value.", "type": "boolean" }, - "count": { - "description": "The count value.", + "changed_at": { + "description": "The changed at value.", + "nullable": true, + "type": "string" + }, + "changed_by": { + "description": "The changed by value.", + "nullable": true, "type": "integer" }, - "description": { - "description": "The description value.", + "changed_by_name": { + "description": "The changed by name value.", "type": "string" }, - "filter_state": { - "description": "The filter state value.", + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "instance_enabled": { + "description": "The instance enabled value.", + "type": "boolean" + }, + "locations": { + "description": "The locations value.", + "items": { + "additionalProperties": false, + "properties": { + "channel_id": { + "description": "The channel id value.", + "nullable": true, + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "kind": { + "description": "The kind value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "url": { + "description": "The url value.", + "type": "string" + } + }, + "required": [ + "effective_policy", + "enabled", + "kind", + "label", + "url" + ], + "type": "object" + }, + "type": "array" + }, + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "organisations": { + "description": "The organisations value.", + "items": { + "additionalProperties": false, + "properties": { + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "owner_active": { + "description": "The owner active value.", "nullable": true, + "type": "boolean" + }, + "owner_id": { + "description": "The owner id value.", + "nullable": true, + "type": "integer" + }, + "owner_name": { + "description": "The owner name value.", "type": "string" }, - "id": { - "description": "The id value.", + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", "type": "integer" }, - "key": { - "description": "The key value.", + "revoke_reason": { + "description": "The revoke reason value.", "type": "string" }, - "name": { - "description": "The name value.", + "revoked_at": { + "description": "The revoked at value.", + "nullable": true, "type": "string" }, - "position": { - "description": "The position value.", + "scope": { + "description": "The scope value.", + "type": "string" + }, + "slug": { + "description": "The slug value.", + "nullable": true, + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, "type": "integer" }, - "ql": { - "description": "The ql value.", + "workspace_name": { + "description": "The workspace name value.", "type": "string" } }, "required": [ - "builtin", - "count", - "id", + "can_administer", + "changed_by_name", + "collection_id", + "enabled", + "instance_enabled", + "locations", + "milestone_swimlanes", "name", - "position", - "ql" + "organisations", + "owner_name", + "policy", + "revision", + "revoke_reason", + "scope", + "standalone_enabled", + "workspace_name" ], "type": "object" } @@ -68022,113 +69447,549 @@ ], "type": "object" }, - "PostCollectionsCollectionIdTestCoverageConfigPayload": { - "additionalProperties": false, - "properties": { - "requirement_item_type_ids": { - "description": "The requirement item type ids value.", - "items": { - "type": "integer" - }, - "type": "array" - } - }, - "required": [ - "requirement_item_type_ids" - ], - "type": "object" - }, - "PostCollectionsCollectionIdTestCoverageConfigResult": { + "PostChannelsChannelIdBoardPlacementsPayload": { "additionalProperties": false, "properties": { - "data": { + "baseline_policy": { "additionalProperties": false, + "description": "The baseline policy value.", "nullable": true, "properties": { - "collection_id": { - "description": "The collection id value.", - "nullable": true, - "type": "integer" - }, - "created_at": { - "description": "The created at value.", - "format": "date-time", + "mode": { + "description": "The mode value.", "type": "string" }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "requirement_item_type_ids": { - "description": "The requirement item type ids value.", + "organisation_ids": { + "description": "The organisation ids value.", "items": { "type": "integer" }, "type": "array" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "nullable": true, - "type": "integer" } }, "required": [ - "created_at", - "id", - "requirement_item_type_ids", - "updated_at" + "mode", + "organisation_ids" ], "type": "object" - } - }, - "required": [ - "data" - ], - "type": "object" - }, - "PostCollectionsPayload": { - "additionalProperties": false, - "properties": { - "category_color": { - "description": "The category color value.", - "type": "string" }, - "category_id": { - "description": "The category id value.", - "nullable": true, + "channel_id": { + "description": "The channel id value.", "type": "integer" }, - "category_name": { - "description": "The category name value.", - "type": "string" + "collection_id": { + "description": "The collection id value.", + "type": "integer" }, - "created_at": { - "description": "The created at value.", - "type": "string" + "display_order": { + "description": "The display order value.", + "type": "integer" }, - "created_by": { - "description": "The created by value.", + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", "nullable": true, - "type": "integer" + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" }, - "creator_email": { - "description": "The creator email value.", - "type": "string" + "enabled": { + "description": "The enabled value.", + "type": "boolean" }, - "creator_name": { - "description": "The creator name value.", + "id": { + "description": "The id value.", "type": "string" }, - "description": { - "description": "The description value.", + "label": { + "description": "The label value.", "type": "string" }, - "filter_state": { + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "source_name": { + "description": "The source name value.", + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + } + }, + "required": [ + "channel_id", + "collection_id", + "display_order", + "enabled", + "id", + "label", + "policy", + "revision", + "standalone_enabled" + ], + "type": "object" + }, + "PostChannelsChannelIdBoardPlacementsResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "nullable": true, + "properties": { + "baseline_policy": { + "additionalProperties": false, + "description": "The baseline policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "channel_id": { + "description": "The channel id value.", + "type": "integer" + }, + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "id": { + "description": "The id value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "source_name": { + "description": "The source name value.", + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + } + }, + "required": [ + "channel_id", + "collection_id", + "display_order", + "enabled", + "id", + "label", + "policy", + "revision", + "standalone_enabled" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PostCollectionCategoriesPayload": { + "additionalProperties": false, + "properties": { + "color": { + "description": "The color value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "color", + "created_at", + "description", + "id", + "name", + "updated_at" + ], + "type": "object" + }, + "PostCollectionCategoriesResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "color": { + "description": "The color value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "color", + "created_at", + "description", + "id", + "name", + "updated_at" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PostCollectionsCollectionIdQueuesPayload": { + "additionalProperties": false, + "properties": { + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "ql_query": { + "description": "The ql query value.", + "type": "string" + } + }, + "required": [ + "name", + "ql_query" + ], + "type": "object" + }, + "PostCollectionsCollectionIdQueuesResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "builtin": { + "description": "The builtin value.", + "type": "boolean" + }, + "count": { + "description": "The count value.", + "type": "integer" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "key": { + "description": "The key value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "position": { + "description": "The position value.", + "type": "integer" + }, + "ql": { + "description": "The ql value.", + "type": "string" + } + }, + "required": [ + "builtin", + "count", + "id", + "name", + "position", + "ql" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PostCollectionsCollectionIdTestCoverageConfigPayload": { + "additionalProperties": false, + "properties": { + "requirement_item_type_ids": { + "description": "The requirement item type ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "requirement_item_type_ids" + ], + "type": "object" + }, + "PostCollectionsCollectionIdTestCoverageConfigResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "nullable": true, + "properties": { + "collection_id": { + "description": "The collection id value.", + "nullable": true, + "type": "integer" + }, + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "requirement_item_type_ids": { + "description": "The requirement item type ids value.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + } + }, + "required": [ + "created_at", + "id", + "requirement_item_type_ids", + "updated_at" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PostCollectionsPayload": { + "additionalProperties": false, + "properties": { + "board_enabled": { + "description": "The board enabled value.", + "type": "boolean" + }, + "board_ever_published": { + "description": "The board ever published value.", + "type": "boolean" + }, + "board_standalone_enabled": { + "description": "The board standalone enabled value.", + "type": "boolean" + }, + "category_color": { + "description": "The category color value.", + "type": "string" + }, + "category_id": { + "description": "The category id value.", + "nullable": true, + "type": "integer" + }, + "category_name": { + "description": "The category name value.", + "type": "string" + }, + "created_at": { + "description": "The created at value.", + "type": "string" + }, + "created_by": { + "description": "The created by value.", + "nullable": true, + "type": "integer" + }, + "creator_email": { + "description": "The creator email value.", + "type": "string" + }, + "creator_name": { + "description": "The creator name value.", + "type": "string" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "filter_state": { "description": "The filter state value.", "nullable": true, "type": "string" @@ -68153,6 +70014,20 @@ "description": "The public milestone swimlanes value.", "type": "boolean" }, + "public_revoke_reason": { + "description": "The public revoke reason value.", + "type": "string" + }, + "public_revoked_at": { + "description": "The public revoked at value.", + "nullable": true, + "type": "string" + }, + "public_revoked_by": { + "description": "The public revoked by value.", + "nullable": true, + "type": "integer" + }, "public_slug": { "description": "The public slug value.", "nullable": true, @@ -68162,6 +70037,20 @@ "description": "The ql query value.", "type": "string" }, + "sharing_changed_at": { + "description": "The sharing changed at value.", + "nullable": true, + "type": "string" + }, + "sharing_changed_by": { + "description": "The sharing changed by value.", + "nullable": true, + "type": "integer" + }, + "sharing_revision": { + "description": "The sharing revision value.", + "type": "integer" + }, "updated_at": { "description": "The updated at value.", "type": "string" @@ -68173,6 +70062,9 @@ } }, "required": [ + "board_enabled", + "board_ever_published", + "board_standalone_enabled", "created_at", "description", "id", @@ -68180,7 +70072,9 @@ "is_public", "name", "public_milestone_swimlanes", + "public_revoke_reason", "ql_query", + "sharing_revision", "updated_at" ], "type": "object" @@ -68191,6 +70085,18 @@ "data": { "additionalProperties": false, "properties": { + "board_enabled": { + "description": "The board enabled value.", + "type": "boolean" + }, + "board_ever_published": { + "description": "The board ever published value.", + "type": "boolean" + }, + "board_standalone_enabled": { + "description": "The board standalone enabled value.", + "type": "boolean" + }, "category_color": { "description": "The category color value.", "type": "string" @@ -68250,6 +70156,20 @@ "description": "The public milestone swimlanes value.", "type": "boolean" }, + "public_revoke_reason": { + "description": "The public revoke reason value.", + "type": "string" + }, + "public_revoked_at": { + "description": "The public revoked at value.", + "nullable": true, + "type": "string" + }, + "public_revoked_by": { + "description": "The public revoked by value.", + "nullable": true, + "type": "integer" + }, "public_slug": { "description": "The public slug value.", "nullable": true, @@ -68259,6 +70179,20 @@ "description": "The ql query value.", "type": "string" }, + "sharing_changed_at": { + "description": "The sharing changed at value.", + "nullable": true, + "type": "string" + }, + "sharing_changed_by": { + "description": "The sharing changed by value.", + "nullable": true, + "type": "integer" + }, + "sharing_revision": { + "description": "The sharing revision value.", + "type": "integer" + }, "updated_at": { "description": "The updated at value.", "type": "string" @@ -68270,6 +70204,9 @@ } }, "required": [ + "board_enabled", + "board_ever_published", + "board_standalone_enabled", "created_at", "description", "id", @@ -68277,7 +70214,9 @@ "is_public", "name", "public_milestone_swimlanes", + "public_revoke_reason", "ql_query", + "sharing_revision", "updated_at" ], "type": "object" @@ -98556,6 +100495,627 @@ ], "type": "object" }, + "PutBoardPublicationsCollectionIdPayload": { + "additionalProperties": false, + "properties": { + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "slug": { + "description": "The slug value.", + "nullable": true, + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + } + }, + "required": [ + "enabled", + "milestone_swimlanes", + "policy", + "revision", + "standalone_enabled" + ], + "type": "object" + }, + "PutBoardPublicationsCollectionIdResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "nullable": true, + "properties": { + "can_administer": { + "description": "The can administer value.", + "type": "boolean" + }, + "changed_at": { + "description": "The changed at value.", + "nullable": true, + "type": "string" + }, + "changed_by": { + "description": "The changed by value.", + "nullable": true, + "type": "integer" + }, + "changed_by_name": { + "description": "The changed by name value.", + "type": "string" + }, + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "instance_enabled": { + "description": "The instance enabled value.", + "type": "boolean" + }, + "locations": { + "description": "The locations value.", + "items": { + "additionalProperties": false, + "properties": { + "channel_id": { + "description": "The channel id value.", + "nullable": true, + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "kind": { + "description": "The kind value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "url": { + "description": "The url value.", + "type": "string" + } + }, + "required": [ + "effective_policy", + "enabled", + "kind", + "label", + "url" + ], + "type": "object" + }, + "type": "array" + }, + "milestone_swimlanes": { + "description": "The milestone swimlanes value.", + "type": "boolean" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "organisations": { + "description": "The organisations value.", + "items": { + "additionalProperties": false, + "properties": { + "id": { + "description": "The id value.", + "type": "integer" + }, + "name": { + "description": "The name value.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "owner_active": { + "description": "The owner active value.", + "nullable": true, + "type": "boolean" + }, + "owner_id": { + "description": "The owner id value.", + "nullable": true, + "type": "integer" + }, + "owner_name": { + "description": "The owner name value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "revoke_reason": { + "description": "The revoke reason value.", + "type": "string" + }, + "revoked_at": { + "description": "The revoked at value.", + "nullable": true, + "type": "string" + }, + "scope": { + "description": "The scope value.", + "type": "string" + }, + "slug": { + "description": "The slug value.", + "nullable": true, + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + }, + "workspace_id": { + "description": "The workspace id value.", + "nullable": true, + "type": "integer" + }, + "workspace_name": { + "description": "The workspace name value.", + "type": "string" + } + }, + "required": [ + "can_administer", + "changed_by_name", + "collection_id", + "enabled", + "instance_enabled", + "locations", + "milestone_swimlanes", + "name", + "organisations", + "owner_name", + "policy", + "revision", + "revoke_reason", + "scope", + "standalone_enabled", + "workspace_name" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PutChannelsChannelIdBoardPlacementsPlacementIdPayload": { + "additionalProperties": false, + "properties": { + "baseline_policy": { + "additionalProperties": false, + "description": "The baseline policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "channel_id": { + "description": "The channel id value.", + "type": "integer" + }, + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "id": { + "description": "The id value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "source_name": { + "description": "The source name value.", + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + } + }, + "required": [ + "channel_id", + "collection_id", + "display_order", + "enabled", + "id", + "label", + "policy", + "revision", + "standalone_enabled" + ], + "type": "object" + }, + "PutChannelsChannelIdBoardPlacementsPlacementIdResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "nullable": true, + "properties": { + "baseline_policy": { + "additionalProperties": false, + "description": "The baseline policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "channel_id": { + "description": "The channel id value.", + "type": "integer" + }, + "collection_id": { + "description": "The collection id value.", + "type": "integer" + }, + "display_order": { + "description": "The display order value.", + "type": "integer" + }, + "effective_policy": { + "additionalProperties": false, + "description": "The effective policy value.", + "nullable": true, + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "enabled": { + "description": "The enabled value.", + "type": "boolean" + }, + "id": { + "description": "The id value.", + "type": "string" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "policy": { + "additionalProperties": false, + "description": "The policy value.", + "properties": { + "mode": { + "description": "The mode value.", + "type": "string" + }, + "organisation_ids": { + "description": "The organisation ids value.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "mode", + "organisation_ids" + ], + "type": "object" + }, + "revision": { + "description": "The revision value.", + "type": "integer" + }, + "source_name": { + "description": "The source name value.", + "type": "string" + }, + "standalone_enabled": { + "description": "The standalone enabled value.", + "type": "boolean" + } + }, + "required": [ + "channel_id", + "collection_id", + "display_order", + "enabled", + "id", + "label", + "policy", + "revision", + "standalone_enabled" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PutChannelsChannelIdExperiencePayload": { + "additionalProperties": false, + "properties": { + "default_module": { + "description": "The default module value.", + "type": "string" + }, + "modules": { + "description": "The modules value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "navigation": { + "description": "The navigation value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "presentation": { + "description": "The presentation value.", + "type": "string" + }, + "revision": { + "description": "The revision value.", + "type": "string" + } + }, + "required": [ + "default_module", + "modules", + "navigation", + "presentation", + "revision" + ], + "type": "object" + }, + "PutChannelsChannelIdExperienceResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "nullable": true, + "properties": { + "default_module": { + "description": "The default module value.", + "type": "string" + }, + "modules": { + "description": "The modules value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "navigation": { + "description": "The navigation value.", + "items": { + "type": "string" + }, + "type": "array" + }, + "presentation": { + "description": "The presentation value.", + "type": "string" + }, + "revision": { + "description": "The revision value.", + "type": "string" + } + }, + "required": [ + "default_module", + "modules", + "navigation", + "presentation", + "revision" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, "PutCollectionsCollectionIdBoardConfigurationPayload": { "additionalProperties": false, "properties": { @@ -101372,770 +103932,2001 @@ "nullable": true, "type": "boolean" }, - "label": { - "description": "The label value.", - "type": "string" + "label": { + "description": "The label value.", + "type": "string" + }, + "metric_id": { + "description": "The metric id value.", + "nullable": true, + "type": "integer" + }, + "percent": { + "description": "The percent value.", + "type": "integer" + } + }, + "required": [ + "label", + "percent" + ], + "type": "object" + }, + "PutWorkspacesWorkspaceIdSlaWarningThresholdsThresholdIdResult": { + "additionalProperties": false, + "properties": { + "data": { + "additionalProperties": false, + "nullable": true, + "properties": { + "created_at": { + "description": "The created at value.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "is_active": { + "description": "The is active value.", + "type": "boolean" + }, + "label": { + "description": "The label value.", + "type": "string" + }, + "metric_id": { + "description": "The metric id value.", + "nullable": true, + "type": "integer" + }, + "metric_name": { + "description": "The metric name value.", + "type": "string" + }, + "percent": { + "description": "The percent value.", + "type": "integer" + }, + "updated_at": { + "description": "The updated at value.", + "format": "date-time", + "type": "string" + }, + "workspace_id": { + "description": "The workspace id value.", + "type": "integer" + } + }, + "required": [ + "created_at", + "id", + "is_active", + "label", + "percent", + "updated_at", + "workspace_id" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PutWorkspacesWorkspaceKeyQueuesBuiltinsBuiltinKeyPayload": { + "additionalProperties": false, + "properties": { + "hidden": { + "description": "The hidden value.", + "type": "boolean" + } + }, + "required": [ + "hidden" + ], + "type": "object" + }, + "PutWorkspacesWorkspaceKeyQueuesBuiltinsBuiltinKeyResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "builtin": { + "description": "The builtin value.", + "type": "boolean" + }, + "count": { + "description": "The count value.", + "type": "integer" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "key": { + "description": "The key value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "position": { + "description": "The position value.", + "type": "integer" + }, + "ql": { + "description": "The ql value.", + "type": "string" + } + }, + "required": [ + "builtin", + "count", + "id", + "name", + "position", + "ql" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "PutWorkspacesWorkspaceKeyQueuesOrderPayload": { + "additionalProperties": false, + "properties": { + "ids": { + "description": "Resource IDs in preferred response order. At most 500 IDs are accepted; duplicates use their first occurrence and missing or invisible resources are omitted.", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "ids" + ], + "type": "object" + }, + "PutWorkspacesWorkspaceKeyQueuesOrderResult": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "additionalProperties": false, + "properties": { + "builtin": { + "description": "The builtin value.", + "type": "boolean" + }, + "count": { + "description": "The count value.", + "type": "integer" + }, + "description": { + "description": "The description value.", + "type": "string" + }, + "filter_state": { + "description": "The filter state value.", + "nullable": true, + "type": "string" + }, + "id": { + "description": "The id value.", + "type": "integer" + }, + "key": { + "description": "The key value.", + "type": "string" + }, + "name": { + "description": "The name value.", + "type": "string" + }, + "position": { + "description": "The position value.", + "type": "integer" + }, + "ql": { + "description": "The ql value.", + "type": "string" + } + }, + "required": [ + "builtin", + "count", + "id", + "name", + "position", + "ql" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "RoadmapHierarchyDate": { + "additionalProperties": false, + "properties": { + "end_date": { + "description": "Planned end date.", + "format": "date", + "type": "string" + }, + "id": { + "description": "Item identifier.", + "minimum": 1, + "type": "integer" + }, + "parent_id": { + "description": "Parent item, or null for a root.", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "start_date": { + "description": "Planned start date.", + "format": "date", + "type": "string" + }, + "workspace_id": { + "description": "Owning workspace.", + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "id", + "workspace_id", + "parent_id" + ], + "type": "object" + }, + "RoadmapHierarchyDates": { + "additionalProperties": false, + "properties": { + "items": { + "description": "Distinct roots and descendants ordered by item ID.", + "items": { + "$ref": "#/components/schemas/RoadmapHierarchyDate" + }, + "type": "array" + }, + "truncated": { + "description": "Whether the 5,000-item result cap was reached.", + "type": "boolean" + } + }, + "required": [ + "items", + "truncated" + ], + "type": "object" + }, + "RoadmapHierarchyDatesDocument": { + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/components/schemas/RoadmapHierarchyDates" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "RoadmapHierarchyDatesRequest": { + "additionalProperties": false, + "properties": { + "root_ids": { + "description": "Visible hierarchy roots to expand. Omission or an empty array returns an empty result.", + "items": { + "minimum": 1, + "type": "integer" + }, + "maxItems": 500, + "type": "array", + "uniqueItems": true + } + }, + "type": "object" + }, + "StatusChangeInfo": { + "additionalProperties": false, + "properties": { + "id": { + "description": "Compatible status identifier.", + "minimum": 1, + "type": "integer" + }, + "name": { + "description": "Compatible status display name.", + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "type": "object" + }, + "TestRun": { + "additionalProperties": false, + "properties": { + "assignee_avatar": { + "description": "Assignee avatar URL.", + "readOnly": true, + "type": "string" + }, + "assignee_email": { + "description": "Assignee email address.", + "format": "email", + "readOnly": true, + "type": "string" + }, + "assignee_id": { + "description": "User assigned to execute the run.", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "assignee_name": { + "description": "Assignee display name.", + "readOnly": true, + "type": "string" + }, + "created_at": { + "description": "Creation timestamp.", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "ended_at": { + "description": "Execution end timestamp, or null while active.", + "format": "date-time", + "nullable": true, + "readOnly": true, + "type": "string" + }, + "id": { + "description": "Test-run identifier.", + "minimum": 1, + "readOnly": true, + "type": "integer" + }, + "name": { + "description": "Test-run display name.", + "minLength": 1, + "type": "string" + }, + "plan_id": { + "description": "Test plan executed by this run.", + "minimum": 1, + "type": "integer" + }, + "started_at": { + "description": "Execution start timestamp.", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "template_id": { + "description": "Template used to create the run.", + "minimum": 1, + "type": "integer" + }, + "workspace_id": { + "description": "Owning workspace identifier.", + "minimum": 1, + "readOnly": true, + "type": "integer" + } + }, + "required": [ + "id", + "workspace_id", + "plan_id", + "name", + "started_at", + "ended_at", + "created_at" + ], + "type": "object" + }, + "TestRunArrayDocument": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/TestRun" + }, + "type": "array" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "TestRunCreateRequest": { + "additionalProperties": false, + "properties": { + "assignee_id": { + "description": "User assigned to execute the run.", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "name": { + "description": "Test-run display name.", + "minLength": 1, + "type": "string" + }, + "plan_id": { + "description": "Test plan to execute.", + "minimum": 1, + "type": "integer" + }, + "template_id": { + "description": "Template that supplied defaults.", + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "plan_id", + "name" + ], + "type": "object" + }, + "TestRunDocument": { + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/components/schemas/TestRun" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "TestRunPageDocument": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/TestRun" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "type": "object" + }, + "TestRunPatchRequest": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "assignee_id": { + "description": "Replacement assignee; null clears the assignment.", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "name": { + "description": "Replacement test-run name.", + "minLength": 1, + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "TestRunTemplate": { + "additionalProperties": false, + "properties": { + "created_at": { + "description": "Creation timestamp.", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "description": { + "description": "Template description.", + "type": "string" + }, + "id": { + "description": "Test-run template identifier.", + "minimum": 1, + "readOnly": true, + "type": "integer" + }, + "name": { + "description": "Template display name.", + "minLength": 1, + "type": "string" + }, + "plan_id": { + "description": "Test plan executed by this template.", + "minimum": 1, + "type": "integer" + }, + "plan_name": { + "description": "Referenced test-plan name.", + "readOnly": true, + "type": "string" + }, + "updated_at": { + "description": "Last update timestamp.", + "format": "date-time", + "readOnly": true, + "type": "string" + }, + "workspace_id": { + "description": "Owning workspace identifier.", + "minimum": 1, + "readOnly": true, + "type": "integer" + } + }, + "required": [ + "id", + "workspace_id", + "plan_id", + "name", + "description", + "created_at", + "updated_at" + ], + "type": "object" + }, + "TestRunTemplateCreateRequest": { + "additionalProperties": false, + "properties": { + "description": { + "description": "Template description.", + "type": "string" + }, + "name": { + "description": "Template display name.", + "minLength": 1, + "type": "string" + }, + "plan_id": { + "description": "Test plan executed by this template.", + "minimum": 1, + "type": "integer" + } + }, + "required": [ + "plan_id", + "name" + ], + "type": "object" + }, + "TestRunTemplateDocument": { + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/components/schemas/TestRunTemplate" + } + }, + "required": [ + "data" + ], + "type": "object" + }, + "TestRunTemplatePageDocument": { + "additionalProperties": false, + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/TestRunTemplate" + }, + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "type": "object" + }, + "TestRunTemplatePatchRequest": { + "additionalProperties": false, + "minProperties": 1, + "properties": { + "description": { + "description": "Replacement description.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "Replacement display name.", + "minLength": 1, + "nullable": true, + "type": "string" + }, + "plan_id": { + "description": "Replacement test plan.", + "minimum": 1, + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "User": { + "properties": { + "agent_presence": { + "type": "string" + }, + "avatar_url": { + "nullable": true, + "type": "string" + }, + "created_at": { + "format": "date-time", + "type": "string" + }, + "email": { + "type": "string" + }, + "first_name": { + "type": "string" + }, + "full_name": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "is_active": { + "type": "boolean" + }, + "is_agent": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "timezone": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "id", + "email", + "username", + "first_name", + "last_name", + "full_name", + "is_active", + "is_agent", + "agent_presence", + "avatar_url", + "timezone", + "language", + "created_at" + ], + "type": "object" + }, + "UserDocument": { + "properties": { + "data": { + "$ref": "#/components/schemas/User" + } + }, + "required": [ + "data" + ], + "type": "object" + } + }, + "securitySchemes": { + "BearerAuth": { + "bearerFormat": "crw_*", + "description": "Use a Windshift API token. Each operation lists its enforced token scopes in x-required-scopes; session clients use the /api/v2 mount and do not send bearer credentials. The authenticated /api/api-tokens/scope-catalog endpoint returns every grantable scope with picker labels and descriptions.", + "scheme": "bearer", + "type": "http" + } + } + }, + "info": { + "description": "Canonical API v2. Browser clients use the session-authenticated /api/v2 mount; non-browser clients use this bearer-authenticated mount.", + "title": "Windshift API v2", + "version": "2.0.0" + }, + "openapi": "3.0.3", + "paths": { + "/action-templates": { + "get": { + "description": "List action templates. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getActionTemplates", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetActionTemplatesResult" + } + } + }, + "description": "List action templates response." + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "BearerAuth": [] + } + ], + "summary": "List action templates", + "tags": [ + "Automation" + ], + "x-required-scopes": [ + "actions:read" + ] + } + }, + "/admin/api-tokens": { + "get": { + "description": "List API tokens. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope.", + "operationId": "getAdminApiTokens", + "parameters": [ + { + "description": "Filter by user ID.", + "in": "query", + "name": "user_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "One-based page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminApiTokensResult" + } + } + }, + "description": "List API tokens response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "BearerAuth": [] + } + ], + "summary": "List API tokens", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:api-tokens:read" + ] + } + }, + "/admin/api-tokens/{token_id}": { + "delete": { + "description": "Revoke an API token. The server verifies resource ownership and deletion preconditions before removing the resource. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope.", + "operationId": "deleteAdminApiTokensTokenId", + "parameters": [ + { + "description": "Token id.", + "in": "path", + "name": "token_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "Request completed successfully with no response body." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "BearerAuth": [] + } + ], + "summary": "Revoke an API token", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:api-tokens:write" + ] + } + }, + "/admin/audit-logs": { + "get": { + "description": "List audit log entries. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope.", + "operationId": "getAdminAuditLogs", + "parameters": [ + { + "description": "Filter by user ID.", + "in": "query", + "name": "user_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Exact match filter.", + "in": "query", + "name": "action_type", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Exact match filter.", + "in": "query", + "name": "resource_type", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Exact match on the event source (USER, SCIM, SYSTEM).", + "in": "query", + "name": "source", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Filter by the success flag.", + "in": "query", + "name": "success", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "description": "Case-insensitive substring match on username, resource name, or action type.", + "in": "query", + "name": "search", + "required": false, + "schema": { + "type": "string" + } }, - "metric_id": { - "description": "The metric id value.", - "nullable": true, - "type": "integer" + { + "description": "Inclusive RFC3339 timestamp bound.", + "in": "query", + "name": "from", + "required": false, + "schema": { + "format": "date-time", + "type": "string" + } }, - "percent": { - "description": "The percent value.", - "type": "integer" + { + "description": "Inclusive RFC3339 timestamp bound.", + "in": "query", + "name": "to", + "required": false, + "schema": { + "format": "date-time", + "type": "string" + } + }, + { + "description": "One-based page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } } - }, - "required": [ - "label", - "percent" ], - "type": "object" - }, - "PutWorkspacesWorkspaceIdSlaWarningThresholdsThresholdIdResult": { - "additionalProperties": false, - "properties": { - "data": { - "additionalProperties": false, - "nullable": true, - "properties": { - "created_at": { - "description": "The created at value.", - "format": "date-time", - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "is_active": { - "description": "The is active value.", - "type": "boolean" - }, - "label": { - "description": "The label value.", - "type": "string" - }, - "metric_id": { - "description": "The metric id value.", - "nullable": true, - "type": "integer" - }, - "metric_name": { - "description": "The metric name value.", - "type": "string" - }, - "percent": { - "description": "The percent value.", - "type": "integer" - }, - "updated_at": { - "description": "The updated at value.", - "format": "date-time", - "type": "string" - }, - "workspace_id": { - "description": "The workspace id value.", - "type": "integer" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminAuditLogsResult" + } } }, - "required": [ - "created_at", - "id", - "is_active", - "label", - "percent", - "updated_at", - "workspace_id" - ], - "type": "object" + "description": "List audit log entries response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "data" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "PutWorkspacesWorkspaceKeyQueuesBuiltinsBuiltinKeyPayload": { - "additionalProperties": false, - "properties": { - "hidden": { - "description": "The hidden value.", - "type": "boolean" + "summary": "List audit log entries", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:audit-logs:read" + ] + } + }, + "/admin/audit-logs/since": { + "get": { + "description": "Requires system administrator permission and admin:audit-logs:read. Returns entries with ID greater than after_id in ascending order inside the v2 data envelope. Persist next_after_id for the next call. Defaults to 500 entries, clamps limit to 1000, and sets has_more when the batch fills the limit. An empty batch preserves after_id.", + "operationId": "getAdminAuditLogsSince", + "parameters": [ + { + "description": "Exclusive ID cursor. Entries are ordered by ascending ID.", + "in": "query", + "name": "after_id", + "required": false, + "schema": { + "default": 0, + "minimum": 0, + "type": "integer" + } + }, + { + "description": "Maximum entries; values above 1000 are clamped to 1000.", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 500, + "minimum": 1, + "type": "integer" + } } - }, - "required": [ - "hidden" ], - "type": "object" - }, - "PutWorkspacesWorkspaceKeyQueuesBuiltinsBuiltinKeyResult": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "additionalProperties": false, - "properties": { - "builtin": { - "description": "The builtin value.", - "type": "boolean" - }, - "count": { - "description": "The count value.", - "type": "integer" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "filter_state": { - "description": "The filter state value.", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "key": { - "description": "The key value.", - "type": "string" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "position": { - "description": "The position value.", - "type": "integer" - }, - "ql": { - "description": "The ql value.", - "type": "string" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminAuditLogsSinceResult" } - }, - "required": [ - "builtin", - "count", - "id", - "name", - "position", - "ql" - ], - "type": "object" + } }, - "type": "array" + "description": "Stream audit log entries response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "data" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "PutWorkspacesWorkspaceKeyQueuesOrderPayload": { - "additionalProperties": false, - "properties": { - "ids": { - "description": "Resource IDs in preferred response order. At most 500 IDs are accepted; duplicates use their first occurrence and missing or invisible resources are omitted.", - "items": { + "summary": "Stream audit log entries", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:audit-logs:read" + ] + } + }, + "/admin/board-publications": { + "get": { + "description": "Inventory board publications across all owners. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state. Requires system administrator permission; a publishing permission alone does not grant cross-owner inventory access.", + "operationId": "getAdminBoardPublications", + "parameters": [ + { + "description": "One-based page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, "type": "integer" - }, - "type": "array" + } + }, + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Case-insensitive board name or slug substring.", + "in": "query", + "name": "q", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Restricts publication metadata to this resource.", + "in": "query", + "name": "workspace_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Restricts publication metadata to this resource.", + "in": "query", + "name": "owner_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Restricts publication metadata to this resource.", + "in": "query", + "name": "organisation_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Only globally scoped collections.", + "in": "query", + "name": "global", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "Publication state.", + "in": "query", + "name": "state", + "required": false, + "schema": { + "enum": [ + "all", + "enabled", + "disabled", + "revoked" + ], + "type": "string" + } + }, + { + "description": "Board baseline audience mode.", + "in": "query", + "name": "access_mode", + "required": false, + "schema": { + "enum": [ + "public", + "organisations" + ], + "type": "string" + } } - }, - "required": [ - "ids" ], - "type": "object" - }, - "PutWorkspacesWorkspaceKeyQueuesOrderResult": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "additionalProperties": false, - "properties": { - "builtin": { - "description": "The builtin value.", - "type": "boolean" - }, - "count": { - "description": "The count value.", - "type": "integer" - }, - "description": { - "description": "The description value.", - "type": "string" - }, - "filter_state": { - "description": "The filter state value.", - "nullable": true, - "type": "string" - }, - "id": { - "description": "The id value.", - "type": "integer" - }, - "key": { - "description": "The key value.", - "type": "string" - }, - "name": { - "description": "The name value.", - "type": "string" - }, - "position": { - "description": "The position value.", - "type": "integer" - }, - "ql": { - "description": "The ql value.", - "type": "string" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminBoardPublicationsResult" } - }, - "required": [ - "builtin", - "count", - "id", - "name", - "position", - "ql" - ], - "type": "object" + } }, - "type": "array" + "description": "Inventory board publications across all owners response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "data" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "RoadmapHierarchyDate": { - "additionalProperties": false, - "properties": { - "end_date": { - "description": "Planned end date.", - "format": "date", - "type": "string" + "summary": "Inventory board publications across all owners", + "tags": [ + "Governance" + ], + "x-required-scopes": [ + "collections:read" + ] + } + }, + "/admin/object-translations/canonical-differences": { + "get": { + "description": "Find canonical translation differences. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "getAdminObjectTranslationsCanonicalDifferences", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminObjectTranslationsCanonicalDifferencesResult" + } + } + }, + "description": "Find canonical translation differences response." }, - "id": { - "description": "Item identifier.", - "minimum": 1, - "type": "integer" + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, - "parent_id": { - "description": "Parent item, or null for a root.", - "minimum": 1, - "nullable": true, - "type": "integer" + "401": { + "$ref": "#/components/responses/AuthenticationError" }, - "start_date": { - "description": "Planned start date.", - "format": "date", - "type": "string" + "403": { + "$ref": "#/components/responses/PermissionError" }, - "workspace_id": { - "description": "Owning workspace.", - "minimum": 1, - "type": "integer" + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "id", - "workspace_id", - "parent_id" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "RoadmapHierarchyDates": { - "additionalProperties": false, - "properties": { - "items": { - "description": "Distinct roots and descendants ordered by item ID.", - "items": { - "$ref": "#/components/schemas/RoadmapHierarchyDate" + "summary": "Find canonical translation differences", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:read" + ] + } + }, + "/admin/object-translations/definitions": { + "get": { + "description": "List object translation definitions. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "getAdminObjectTranslationsDefinitions", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminObjectTranslationsDefinitionsResult" + } + } }, - "type": "array" + "description": "List object translation definitions response." }, - "truncated": { - "description": "Whether the 5,000-item result cap was reached.", - "type": "boolean" + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "items", - "truncated" - ], - "type": "object" - }, - "RoadmapHierarchyDatesDocument": { - "additionalProperties": false, - "properties": { - "data": { - "$ref": "#/components/schemas/RoadmapHierarchyDates" + "security": [ + { + "BearerAuth": [] } - }, - "required": [ - "data" ], - "type": "object" - }, - "RoadmapHierarchyDatesRequest": { - "additionalProperties": false, - "properties": { - "root_ids": { - "description": "Visible hierarchy roots to expand. Omission or an empty array returns an empty result.", - "items": { - "minimum": 1, - "type": "integer" + "summary": "List object translation definitions", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:read" + ] + } + }, + "/admin/object-translations/orphans": { + "get": { + "description": "Find orphaned object translations. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "getAdminObjectTranslationsOrphans", + "parameters": [], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminObjectTranslationsOrphansResult" + } + } }, - "maxItems": 500, - "type": "array", - "uniqueItems": true - } - }, - "type": "object" - }, - "StatusChangeInfo": { - "additionalProperties": false, - "properties": { - "id": { - "description": "Compatible status identifier.", - "minimum": 1, - "type": "integer" + "description": "Find orphaned object translations response." }, - "name": { - "description": "Compatible status display name.", - "type": "string" + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "id", - "name" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "TestRun": { - "additionalProperties": false, - "properties": { - "assignee_avatar": { - "description": "Assignee avatar URL.", - "readOnly": true, - "type": "string" - }, - "assignee_email": { - "description": "Assignee email address.", - "format": "email", - "readOnly": true, - "type": "string" - }, - "assignee_id": { - "description": "User assigned to execute the run.", - "minimum": 1, - "nullable": true, - "type": "integer" + "summary": "Find orphaned object translations", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:read" + ] + } + }, + "/admin/object-translations/resolve": { + "post": { + "description": "Resolve object translations. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "postAdminObjectTranslationsResolve", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostAdminObjectTranslationsResolvePayload" + } + } }, - "assignee_name": { - "description": "Assignee display name.", - "readOnly": true, - "type": "string" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostAdminObjectTranslationsResolveResult" + } + } + }, + "description": "Resolve object translations response." }, - "created_at": { - "description": "Creation timestamp.", - "format": "date-time", - "readOnly": true, - "type": "string" + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, - "ended_at": { - "description": "Execution end timestamp, or null while active.", - "format": "date-time", - "nullable": true, - "readOnly": true, - "type": "string" + "401": { + "$ref": "#/components/responses/AuthenticationError" }, - "id": { - "description": "Test-run identifier.", - "minimum": 1, - "readOnly": true, - "type": "integer" + "403": { + "$ref": "#/components/responses/PermissionError" }, - "name": { - "description": "Test-run display name.", - "minLength": 1, - "type": "string" + "404": { + "$ref": "#/components/responses/NotFoundError" }, - "plan_id": { - "description": "Test plan executed by this run.", - "minimum": 1, - "type": "integer" + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" }, - "started_at": { - "description": "Execution start timestamp.", - "format": "date-time", - "readOnly": true, - "type": "string" + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" }, - "template_id": { - "description": "Template used to create the run.", - "minimum": 1, - "type": "integer" + "429": { + "$ref": "#/components/responses/RateLimitError" }, - "workspace_id": { - "description": "Owning workspace identifier.", - "minimum": 1, - "readOnly": true, - "type": "integer" + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "id", - "workspace_id", - "plan_id", - "name", - "started_at", - "ended_at", - "created_at" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "TestRunArrayDocument": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/TestRun" - }, - "type": "array" + "summary": "Resolve object translations", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:read" + ] + } + }, + "/admin/object-translations/{object_type}/{object_id}": { + "get": { + "description": "List object translations. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "getAdminObjectTranslationsObjectTypeObjectId", + "parameters": [ + { + "description": "Object type.", + "in": "path", + "name": "object_type", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Object id.", + "in": "path", + "name": "object_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } } - }, - "required": [ - "data" ], - "type": "object" - }, - "TestRunCreateRequest": { - "additionalProperties": false, - "properties": { - "assignee_id": { - "description": "User assigned to execute the run.", - "minimum": 1, - "nullable": true, - "type": "integer" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAdminObjectTranslationsObjectTypeObjectIdResult" + } + } + }, + "description": "List object translations response." }, - "name": { - "description": "Test-run display name.", - "minLength": 1, - "type": "string" + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, - "plan_id": { - "description": "Test plan to execute.", - "minimum": 1, - "type": "integer" + "401": { + "$ref": "#/components/responses/AuthenticationError" }, - "template_id": { - "description": "Template that supplied defaults.", - "minimum": 1, - "type": "integer" + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "plan_id", - "name" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "TestRunDocument": { - "additionalProperties": false, - "properties": { - "data": { - "$ref": "#/components/schemas/TestRun" + "summary": "List object translations", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:read" + ] + } + }, + "/admin/object-translations/{object_type}/{object_id}/{field}/{locale}": { + "delete": { + "description": "Delete an instance translation. The server verifies resource ownership and deletion preconditions before removing the resource. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "deleteAdminObjectTranslationsObjectTypeObjectIdFieldLocale", + "parameters": [ + { + "description": "Object type.", + "in": "path", + "name": "object_type", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Object id.", + "in": "path", + "name": "object_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Field.", + "in": "path", + "name": "field", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Locale.", + "in": "path", + "name": "locale", + "required": true, + "schema": { + "type": "string" + } } - }, - "required": [ - "data" ], - "type": "object" - }, - "TestRunPageDocument": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/TestRun" - }, - "type": "array" + "responses": { + "204": { + "description": "Request completed successfully with no response body." }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "400": { + "$ref": "#/components/responses/InvalidRequestError" + }, + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "BearerAuth": [] } - }, - "required": [ - "data", - "pagination" ], - "type": "object" + "summary": "Delete an instance translation", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:write" + ] }, - "TestRunPatchRequest": { - "additionalProperties": false, - "minProperties": 1, - "properties": { - "assignee_id": { - "description": "Replacement assignee; null clears the assignment.", - "minimum": 1, - "nullable": true, - "type": "integer" + "put": { + "description": "Create or replace an instance translation. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", + "operationId": "putAdminObjectTranslationsObjectTypeObjectIdFieldLocale", + "parameters": [ + { + "description": "Object type.", + "in": "path", + "name": "object_type", + "required": true, + "schema": { + "type": "string" + } }, - "name": { - "description": "Replacement test-run name.", - "minLength": 1, - "nullable": true, - "type": "string" + { + "description": "Object id.", + "in": "path", + "name": "object_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Field.", + "in": "path", + "name": "field", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Locale.", + "in": "path", + "name": "locale", + "required": true, + "schema": { + "type": "string" + } } - }, - "type": "object" - }, - "TestRunTemplate": { - "additionalProperties": false, - "properties": { - "created_at": { - "description": "Creation timestamp.", - "format": "date-time", - "readOnly": true, - "type": "string" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutAdminObjectTranslationsObjectTypeObjectIdFieldLocalePayload" + } + } }, - "description": { - "description": "Template description.", - "type": "string" + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutAdminObjectTranslationsObjectTypeObjectIdFieldLocaleResult" + } + } + }, + "description": "Create or replace an instance translation response." }, - "id": { - "description": "Test-run template identifier.", - "minimum": 1, - "readOnly": true, - "type": "integer" + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, - "name": { - "description": "Template display name.", - "minLength": 1, - "type": "string" + "401": { + "$ref": "#/components/responses/AuthenticationError" }, - "plan_id": { - "description": "Test plan executed by this template.", - "minimum": 1, - "type": "integer" + "403": { + "$ref": "#/components/responses/PermissionError" }, - "plan_name": { - "description": "Referenced test-plan name.", - "readOnly": true, - "type": "string" + "404": { + "$ref": "#/components/responses/NotFoundError" }, - "updated_at": { - "description": "Last update timestamp.", - "format": "date-time", - "readOnly": true, - "type": "string" + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" }, - "workspace_id": { - "description": "Owning workspace identifier.", - "minimum": 1, - "readOnly": true, - "type": "integer" - } - }, - "required": [ - "id", - "workspace_id", - "plan_id", - "name", - "description", - "created_at", - "updated_at" - ], - "type": "object" - }, - "TestRunTemplateCreateRequest": { - "additionalProperties": false, - "properties": { - "description": { - "description": "Template description.", - "type": "string" + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" }, - "name": { - "description": "Template display name.", - "minLength": 1, - "type": "string" + "429": { + "$ref": "#/components/responses/RateLimitError" }, - "plan_id": { - "description": "Test plan executed by this template.", - "minimum": 1, - "type": "integer" + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "plan_id", - "name" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "TestRunTemplateDocument": { - "additionalProperties": false, - "properties": { - "data": { - "$ref": "#/components/schemas/TestRunTemplate" + "summary": "Create or replace an instance translation", + "tags": [ + "Administration" + ], + "x-required-scopes": [ + "admin:object-translations:write" + ] + } + }, + "/agent-runs/{run_id}": { + "get": { + "description": "Get agent run. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAgentRunsRunId", + "parameters": [ + { + "description": "The run identifier.", + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } } - }, - "required": [ - "data" ], - "type": "object" - }, - "TestRunTemplatePageDocument": { - "additionalProperties": false, - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/TestRunTemplate" + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAgentRunsRunIdResult" + } + } }, - "type": "array" + "description": "Get agent run response." }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" + }, + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "data", - "pagination" + "security": [ + { + "BearerAuth": [] + } ], - "type": "object" - }, - "TestRunTemplatePatchRequest": { - "additionalProperties": false, - "minProperties": 1, - "properties": { - "description": { - "description": "Replacement description.", - "nullable": true, - "type": "string" - }, - "name": { - "description": "Replacement display name.", - "minLength": 1, - "nullable": true, - "type": "string" + "summary": "Get agent run", + "tags": [ + "Agents" + ], + "x-required-scopes": [ + "items:read" + ] + } + }, + "/agent-runs/{run_id}/cancel": { + "post": { + "description": "Cancel agent run. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAgentRunsRunIdCancel", + "parameters": [ + { + "description": "The run identifier.", + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } }, - "plan_id": { - "description": "Replacement test plan.", - "minimum": 1, - "nullable": true, - "type": "integer" + { + "description": "Whether to force the persisted run into the canceled state when cooperative cancellation cannot reach the worker.", + "in": "query", + "name": "force", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } } - }, - "type": "object" - }, - "User": { - "properties": { - "agent_presence": { - "type": "string" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostAgentRunsRunIdCancelResult" + } + } + }, + "description": "Cancel agent run response." }, - "avatar_url": { - "nullable": true, - "type": "string" + "401": { + "$ref": "#/components/responses/AuthenticationError" }, - "created_at": { - "format": "date-time", - "type": "string" + "403": { + "$ref": "#/components/responses/PermissionError" }, - "email": { - "type": "string" + "404": { + "$ref": "#/components/responses/NotFoundError" }, - "first_name": { - "type": "string" + "429": { + "$ref": "#/components/responses/RateLimitError" }, - "full_name": { - "type": "string" + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ + { + "BearerAuth": [] + } + ], + "summary": "Cancel agent run", + "tags": [ + "Agents" + ], + "x-required-scopes": [ + "items:write" + ] + } + }, + "/agent-runs/{run_id}/events": { + "get": { + "description": "Returns up to 200 visible run events after an operation-bound opaque cursor. Events use stable ascending ID order, next_cursor resumes exclusively after the final returned event, and partial pages are never returned on failure.", + "operationId": "getAgentRunsRunIdEvents", + "parameters": [ + { + "description": "The run identifier.", + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } }, - "id": { - "type": "integer" + { + "description": "Opaque continuation cursor returned by the preceding response. Cursors are operation-specific and cannot be combined with removed timestamp or ID boundaries.", + "in": "query", + "name": "cursor", + "required": false, + "schema": { + "minLength": 1, + "type": "string" + } }, - "is_active": { - "type": "boolean" + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 200, + "maximum": 200, + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAgentRunsRunIdEventsResult" + } + } + }, + "description": "List agent run events response." }, - "is_agent": { - "type": "boolean" + "401": { + "$ref": "#/components/responses/AuthenticationError" }, - "language": { - "type": "string" + "403": { + "$ref": "#/components/responses/PermissionError" }, - "last_name": { - "type": "string" + "404": { + "$ref": "#/components/responses/NotFoundError" }, - "timezone": { - "type": "string" + "429": { + "$ref": "#/components/responses/RateLimitError" }, - "username": { - "type": "string" + "500": { + "$ref": "#/components/responses/InternalError" } }, - "required": [ - "id", - "email", - "username", - "first_name", - "last_name", - "full_name", - "is_active", - "is_agent", - "agent_presence", - "avatar_url", - "timezone", - "language", - "created_at" - ], - "type": "object" - }, - "UserDocument": { - "properties": { - "data": { - "$ref": "#/components/schemas/User" + "security": [ + { + "BearerAuth": [] } - }, - "required": [ - "data" ], - "type": "object" + "summary": "List agent run events", + "tags": [ + "Agents" + ], + "x-required-scopes": [ + "items:read" + ] } }, - "securitySchemes": { - "BearerAuth": { - "bearerFormat": "crw_*", - "description": "Use a Windshift API token. Each operation lists its enforced token scopes in x-required-scopes; session clients use the /api/v2 mount and do not send bearer credentials. The authenticated /api/api-tokens/scope-catalog endpoint returns every grantable scope with picker labels and descriptions.", - "scheme": "bearer", - "type": "http" - } - } - }, - "info": { - "description": "Canonical API v2. Browser clients use the session-authenticated /api/v2 mount; non-browser clients use this bearer-authenticated mount.", - "title": "Windshift API v2", - "version": "2.0.0" - }, - "openapi": "3.0.3", - "paths": { - "/action-templates": { + "/agent-runs/{run_id}/usage": { "get": { - "description": "List action templates. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getActionTemplates", - "parameters": [], + "description": "Get agent run usage. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAgentRunsRunIdUsage", + "parameters": [ + { + "description": "The run identifier.", + "in": "path", + "name": "run_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetActionTemplatesResult" + "$ref": "#/components/schemas/GetAgentRunsRunIdUsageResult" } } }, - "description": "List action templates response." + "description": "Get agent run usage response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -102143,6 +105934,9 @@ "403": { "$ref": "#/components/responses/PermissionError" }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -102155,49 +105949,49 @@ "BearerAuth": [] } ], - "summary": "List action templates", + "summary": "Get agent run usage", "tags": [ - "Automation" + "Agents" ], "x-required-scopes": [ - "actions:read" + "items:read" ] } }, - "/admin/api-tokens": { + "/approval-sets": { "get": { - "description": "List API tokens. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope.", - "operationId": "getAdminApiTokens", + "description": "List approval sets. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getApprovalSets", "parameters": [ { - "description": "Filter by user ID.", + "description": "One-based page number.", "in": "query", - "name": "user_id", + "name": "page", "required": false, "schema": { + "default": 1, "minimum": 1, "type": "integer" } }, { - "description": "One-based page number.", + "description": "Maximum number of resources to return.", "in": "query", - "name": "page", + "name": "page_size", "required": false, "schema": { - "default": 1, + "default": 50, + "maximum": 1000, "minimum": 1, "type": "integer" } }, { - "description": "Maximum number of resources to return.", + "description": "Restricts results to one workflow.", "in": "query", - "name": "page_size", + "name": "workflow_id", "required": false, "schema": { - "default": 50, - "maximum": 1000, "minimum": 1, "type": "integer" } @@ -102208,14 +106002,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAdminApiTokensResult" + "$ref": "#/components/schemas/GetApprovalSetsResult" } } }, - "description": "List API tokens response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "List approval sets response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -102223,9 +106014,6 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "404": { - "$ref": "#/components/responses/NotFoundError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -102238,34 +106026,38 @@ "BearerAuth": [] } ], - "summary": "List API tokens", + "summary": "List approval sets", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:api-tokens:read" + "workflows:read" ] - } - }, - "/admin/api-tokens/{token_id}": { - "delete": { - "description": "Revoke an API token. The server verifies resource ownership and deletion preconditions before removing the resource. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope.", - "operationId": "deleteAdminApiTokensTokenId", - "parameters": [ - { - "description": "Token id.", - "in": "path", - "name": "token_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" + }, + "post": { + "description": "Create approval set. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postApprovalSets", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostApprovalSetsPayload" + } } - } - ], + }, + "required": true + }, "responses": { - "204": { - "description": "Request completed successfully with no response body." + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostApprovalSetsResult" + } + } + }, + "description": "Create approval set response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -102276,8 +106068,11 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "404": { - "$ref": "#/components/responses/NotFoundError" + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" }, "429": { "$ref": "#/components/responses/RateLimitError" @@ -102291,132 +106086,34 @@ "BearerAuth": [] } ], - "summary": "Revoke an API token", + "summary": "Create approval set", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:api-tokens:write" + "workflows:write" ] } }, - "/admin/audit-logs": { - "get": { - "description": "List audit log entries. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope.", - "operationId": "getAdminAuditLogs", + "/approval-sets/{approval_set_id}": { + "delete": { + "description": "Delete approval set. The server verifies resource ownership and deletion preconditions before removing the resource.", + "operationId": "deleteApprovalSetsApprovalSetId", "parameters": [ { - "description": "Filter by user ID.", - "in": "query", - "name": "user_id", - "required": false, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Exact match filter.", - "in": "query", - "name": "action_type", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Exact match filter.", - "in": "query", - "name": "resource_type", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Exact match on the event source (USER, SCIM, SYSTEM).", - "in": "query", - "name": "source", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Filter by the success flag.", - "in": "query", - "name": "success", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "description": "Case-insensitive substring match on username, resource name, or action type.", - "in": "query", - "name": "search", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Inclusive RFC3339 timestamp bound.", - "in": "query", - "name": "from", - "required": false, - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "description": "Inclusive RFC3339 timestamp bound.", - "in": "query", - "name": "to", - "required": false, - "schema": { - "format": "date-time", - "type": "string" - } - }, - { - "description": "One-based page number.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Maximum number of resources to return.", - "in": "query", - "name": "page_size", - "required": false, + "description": "The approval set identifier.", + "in": "path", + "name": "approval_set_id", + "required": true, "schema": { - "default": 50, - "maximum": 1000, "minimum": 1, "type": "integer" } } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetAdminAuditLogsResult" - } - } - }, - "description": "List audit log entries response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "204": { + "description": "Request completed successfully with no response body." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -102439,38 +106136,24 @@ "BearerAuth": [] } ], - "summary": "List audit log entries", + "summary": "Delete approval set", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:audit-logs:read" + "workflows:write" ] - } - }, - "/admin/audit-logs/since": { + }, "get": { - "description": "Requires system administrator permission and admin:audit-logs:read. Returns entries with ID greater than after_id in ascending order inside the v2 data envelope. Persist next_after_id for the next call. Defaults to 500 entries, clamps limit to 1000, and sets has_more when the batch fills the limit. An empty batch preserves after_id.", - "operationId": "getAdminAuditLogsSince", + "description": "Get approval set. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getApprovalSetsApprovalSetId", "parameters": [ { - "description": "Exclusive ID cursor. Entries are ordered by ascending ID.", - "in": "query", - "name": "after_id", - "required": false, - "schema": { - "default": 0, - "minimum": 0, - "type": "integer" - } - }, - { - "description": "Maximum entries; values above 1000 are clamped to 1000.", - "in": "query", - "name": "limit", - "required": false, + "description": "The approval set identifier.", + "in": "path", + "name": "approval_set_id", + "required": true, "schema": { - "default": 500, "minimum": 1, "type": "integer" } @@ -102481,14 +106164,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAdminAuditLogsSinceResult" + "$ref": "#/components/schemas/GetApprovalSetsApprovalSetIdResult" } } }, - "description": "Stream audit log entries response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "Get approval set response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -102511,30 +106191,49 @@ "BearerAuth": [] } ], - "summary": "Stream audit log entries", + "summary": "Get approval set", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:audit-logs:read" + "workflows:read" ] - } - }, - "/admin/object-translations/canonical-differences": { - "get": { - "description": "Find canonical translation differences. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "getAdminObjectTranslationsCanonicalDifferences", - "parameters": [], + }, + "patch": { + "description": "Patch approval set. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", + "operationId": "patchApprovalSetsApprovalSetId", + "parameters": [ + { + "description": "The approval set identifier.", + "in": "path", + "name": "approval_set_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/merge-patch+json": { + "schema": { + "$ref": "#/components/schemas/PatchApprovalSetsApprovalSetIdPayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAdminObjectTranslationsCanonicalDifferencesResult" + "$ref": "#/components/schemas/PatchApprovalSetsApprovalSetIdResult" } } }, - "description": "Find canonical translation differences response." + "description": "Patch approval set response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -102548,6 +106247,12 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -102560,33 +106265,63 @@ "BearerAuth": [] } ], - "summary": "Find canonical translation differences", + "summary": "Patch approval set", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:read" + "workflows:write" ] } }, - "/admin/object-translations/definitions": { + "/approvals/mine": { "get": { - "description": "List object translation definitions. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "getAdminObjectTranslationsDefinitions", - "parameters": [], + "description": "List my approvals. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getApprovalsMine", + "parameters": [ + { + "description": "One-based page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Restricts approvals to one decision status.", + "in": "query", + "name": "status", + "required": false, + "schema": { + "type": "string" + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAdminObjectTranslationsDefinitionsResult" + "$ref": "#/components/schemas/GetApprovalsMineResult" } } }, - "description": "List object translation definitions response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "List my approvals response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -102594,9 +106329,6 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "404": { - "$ref": "#/components/responses/NotFoundError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -102609,33 +106341,41 @@ "BearerAuth": [] } ], - "summary": "List object translation definitions", + "summary": "List my approvals", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:read" + "approvals:read" ] } }, - "/admin/object-translations/orphans": { + "/approvals/{approval_id}": { "get": { - "description": "Find orphaned object translations. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "getAdminObjectTranslationsOrphans", - "parameters": [], + "description": "Get approval. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getApprovalsApprovalId", + "parameters": [ + { + "description": "The approval identifier.", + "in": "path", + "name": "approval_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAdminObjectTranslationsOrphansResult" + "$ref": "#/components/schemas/GetApprovalsApprovalIdResult" } } }, - "description": "Find orphaned object translations response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "Get approval response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -102658,25 +106398,36 @@ "BearerAuth": [] } ], - "summary": "Find orphaned object translations", + "summary": "Get approval", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:read" + "approvals:read" ] } }, - "/admin/object-translations/resolve": { + "/approvals/{approval_id}/cancellation": { "post": { - "description": "Resolve object translations. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "postAdminObjectTranslationsResolve", - "parameters": [], + "description": "Cancel approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postApprovalsApprovalIdCancellation", + "parameters": [ + { + "description": "The approval identifier.", + "in": "path", + "name": "approval_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAdminObjectTranslationsResolvePayload" + "$ref": "#/components/schemas/PostApprovalsApprovalIdCancellationPayload" } } }, @@ -102687,11 +106438,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAdminObjectTranslationsResolveResult" + "$ref": "#/components/schemas/PostApprovalsApprovalIdCancellationResult" } } }, - "description": "Resolve object translations response." + "description": "Cancel approval response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -102705,6 +106456,9 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "description": "Approval is no longer pending" + }, "413": { "$ref": "#/components/responses/PayloadTooLargeError" }, @@ -102723,33 +106477,24 @@ "BearerAuth": [] } ], - "summary": "Resolve object translations", + "summary": "Cancel approval", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:read" + "approvals:write" ] } }, - "/admin/object-translations/{object_type}/{object_id}": { - "get": { - "description": "List object translations. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "getAdminObjectTranslationsObjectTypeObjectId", + "/approvals/{approval_id}/decisions": { + "post": { + "description": "Decide approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postApprovalsApprovalIdDecisions", "parameters": [ { - "description": "Object type.", - "in": "path", - "name": "object_type", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Object id.", + "description": "The approval identifier.", "in": "path", - "name": "object_id", + "name": "approval_id", "required": true, "schema": { "minimum": 1, @@ -102757,16 +106502,26 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostApprovalsApprovalIdDecisionsPayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAdminObjectTranslationsObjectTypeObjectIdResult" + "$ref": "#/components/schemas/PostApprovalsApprovalIdDecisionsResult" } } }, - "description": "List object translations response." + "description": "Decide approval response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -102780,6 +106535,12 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -102792,61 +106553,51 @@ "BearerAuth": [] } ], - "summary": "List object translations", + "summary": "Decide approval", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:read" + "approvals:write" ] } }, - "/admin/object-translations/{object_type}/{object_id}/{field}/{locale}": { - "delete": { - "description": "Delete an instance translation. The server verifies resource ownership and deletion preconditions before removing the resource. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "deleteAdminObjectTranslationsObjectTypeObjectIdFieldLocale", - "parameters": [ - { - "description": "Object type.", - "in": "path", - "name": "object_type", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Object id.", - "in": "path", - "name": "object_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Field.", - "in": "path", - "name": "field", - "required": true, - "schema": { - "type": "string" - } - }, + "/approvals/{approval_id}/delegations": { + "post": { + "description": "Delegate approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postApprovalsApprovalIdDelegations", + "parameters": [ { - "description": "Locale.", + "description": "The approval identifier.", "in": "path", - "name": "locale", + "name": "approval_id", "required": true, "schema": { - "type": "string" + "minimum": 1, + "type": "integer" } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostApprovalsApprovalIdDelegationsPayload" + } + } + }, + "required": true + }, "responses": { - "204": { - "description": "Request completed successfully with no response body." + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostApprovalsApprovalIdDelegationsResult" + } + } + }, + "description": "Delegate approval response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -102878,31 +106629,24 @@ "BearerAuth": [] } ], - "summary": "Delete an instance translation", + "summary": "Delegate approval", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:write" + "approvals:write" ] - }, - "put": { - "description": "Create or replace an instance translation. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body. Requires system administrator permission and the declared bearer token scope. Responses use the standard v2 envelope. Writes and deletes affect instance translations only; shipped system translations are preserved.", - "operationId": "putAdminObjectTranslationsObjectTypeObjectIdFieldLocale", + } + }, + "/approvals/{approval_id}/steps/{step_id}/approver-refreshes": { + "post": { + "description": "Refresh approval approvers. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postApprovalsApprovalIdStepsStepIdApproverRefreshes", "parameters": [ { - "description": "Object type.", - "in": "path", - "name": "object_type", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Object id.", + "description": "The approval identifier.", "in": "path", - "name": "object_id", + "name": "approval_id", "required": true, "schema": { "minimum": 1, @@ -102910,21 +106654,13 @@ } }, { - "description": "Field.", - "in": "path", - "name": "field", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Locale.", + "description": "The step identifier.", "in": "path", - "name": "locale", + "name": "step_id", "required": true, "schema": { - "type": "string" + "minimum": 1, + "type": "integer" } } ], @@ -102932,7 +106668,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PutAdminObjectTranslationsObjectTypeObjectIdFieldLocalePayload" + "$ref": "#/components/schemas/PostApprovalsApprovalIdStepsStepIdApproverRefreshesPayload" } } }, @@ -102943,11 +106679,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PutAdminObjectTranslationsObjectTypeObjectIdFieldLocaleResult" + "$ref": "#/components/schemas/PostApprovalsApprovalIdStepsStepIdApproverRefreshesResult" } } }, - "description": "Create or replace an instance translation response." + "description": "Refresh approval approvers response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -102979,24 +106715,34 @@ "BearerAuth": [] } ], - "summary": "Create or replace an instance translation", + "summary": "Refresh approval approvers", "tags": [ - "Administration" + "Governance" ], "x-required-scopes": [ - "admin:object-translations:write" + "approvals:write" ] } }, - "/agent-runs/{run_id}": { - "get": { - "description": "Get agent run. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAgentRunsRunId", + "/approvals/{approval_id}/steps/{step_id}/escalations": { + "post": { + "description": "Escalate approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postApprovalsApprovalIdStepsStepIdEscalations", "parameters": [ { - "description": "The run identifier.", + "description": "The approval identifier.", "in": "path", - "name": "run_id", + "name": "approval_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "The step identifier.", + "in": "path", + "name": "step_id", "required": true, "schema": { "minimum": 1, @@ -103009,11 +106755,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAgentRunsRunIdResult" + "$ref": "#/components/schemas/PostApprovalsApprovalIdStepsStepIdEscalationsResult" } } }, - "description": "Get agent run response." + "description": "Escalate approval response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103036,39 +106785,29 @@ "BearerAuth": [] } ], - "summary": "Get agent run", + "summary": "Escalate approval", "tags": [ - "Agents" + "Governance" ], "x-required-scopes": [ - "items:read" + "approvals:write" ] } }, - "/agent-runs/{run_id}/cancel": { - "post": { - "description": "Cancel agent run. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAgentRunsRunIdCancel", + "/asset-categories/{category_id}": { + "get": { + "description": "Get asset category. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetCategoriesCategoryId", "parameters": [ { - "description": "The run identifier.", + "description": "The category identifier.", "in": "path", - "name": "run_id", + "name": "category_id", "required": true, "schema": { "minimum": 1, "type": "integer" } - }, - { - "description": "Whether to force the persisted run into the canceled state when cooperative cancellation cannot reach the worker.", - "in": "query", - "name": "force", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } } ], "responses": { @@ -103076,11 +106815,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAgentRunsRunIdCancelResult" + "$ref": "#/components/schemas/GetAssetCategoriesCategoryIdResult" } } }, - "description": "Cancel agent run response." + "description": "Get asset category response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103103,63 +106842,30 @@ "BearerAuth": [] } ], - "summary": "Cancel agent run", + "summary": "Get asset category", "tags": [ - "Agents" + "Asset management" ], "x-required-scopes": [ - "items:write" + "assets:read" ] } }, - "/agent-runs/{run_id}/events": { + "/asset-roles": { "get": { - "description": "Returns up to 200 visible run events after an operation-bound opaque cursor. Events use stable ascending ID order, next_cursor resumes exclusively after the final returned event, and partial pages are never returned on failure.", - "operationId": "getAgentRunsRunIdEvents", - "parameters": [ - { - "description": "The run identifier.", - "in": "path", - "name": "run_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Opaque continuation cursor returned by the preceding response. Cursors are operation-specific and cannot be combined with removed timestamp or ID boundaries.", - "in": "query", - "name": "cursor", - "required": false, - "schema": { - "minLength": 1, - "type": "string" - } - }, - { - "description": "Maximum number of resources to return.", - "in": "query", - "name": "page_size", - "required": false, - "schema": { - "default": 200, - "maximum": 200, - "minimum": 1, - "type": "integer" - } - } - ], + "description": "List asset roles. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetRoles", + "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAgentRunsRunIdEventsResult" + "$ref": "#/components/schemas/GetAssetRolesResult" } } }, - "description": "List agent run events response." + "description": "List asset roles response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103167,9 +106873,6 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "404": { - "$ref": "#/components/responses/NotFoundError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -103182,24 +106885,24 @@ "BearerAuth": [] } ], - "summary": "List agent run events", + "summary": "List asset roles", "tags": [ - "Agents" + "Asset management" ], "x-required-scopes": [ - "items:read" + "assets:read" ] } }, - "/agent-runs/{run_id}/usage": { + "/asset-roles/{role_id}": { "get": { - "description": "Get agent run usage. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAgentRunsRunIdUsage", + "description": "Get asset role. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetRolesRoleId", "parameters": [ { - "description": "The run identifier.", + "description": "The role identifier.", "in": "path", - "name": "run_id", + "name": "role_id", "required": true, "schema": { "minimum": 1, @@ -103212,11 +106915,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAgentRunsRunIdUsageResult" + "$ref": "#/components/schemas/GetAssetRolesRoleIdResult" } } }, - "description": "Get agent run usage response." + "description": "Get asset role response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103239,19 +106942,19 @@ "BearerAuth": [] } ], - "summary": "Get agent run usage", + "summary": "Get asset role", "tags": [ - "Agents" + "Asset management" ], "x-required-scopes": [ - "items:read" + "assets:read" ] } }, - "/approval-sets": { + "/asset-sets": { "get": { - "description": "List approval sets. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getApprovalSets", + "description": "List asset sets. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSets", "parameters": [ { "description": "One-based page number.", @@ -103275,16 +106978,6 @@ "minimum": 1, "type": "integer" } - }, - { - "description": "Restricts results to one workflow.", - "in": "query", - "name": "workflow_id", - "required": false, - "schema": { - "minimum": 1, - "type": "integer" - } } ], "responses": { @@ -103292,11 +106985,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApprovalSetsResult" + "$ref": "#/components/schemas/GetAssetSetsResult" } } }, - "description": "List approval sets response." + "description": "List asset sets response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103316,41 +107009,41 @@ "BearerAuth": [] } ], - "summary": "List approval sets", + "summary": "List asset sets", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "workflows:read" + "assets:read" ] - }, - "post": { - "description": "Create approval set. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postApprovalSets", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostApprovalSetsPayload" - } + } + }, + "/asset-sets/{asset_set_id}": { + "get": { + "description": "Get asset set. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetId", + "parameters": [ + { + "description": "The asset set identifier.", + "in": "path", + "name": "asset_set_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" } - }, - "required": true - }, + } + ], "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalSetsResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdResult" } } }, - "description": "Create approval set response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "Get asset set response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103358,11 +107051,8 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "413": { - "$ref": "#/components/responses/PayloadTooLargeError" - }, - "415": { - "$ref": "#/components/responses/UnsupportedMediaTypeError" + "404": { + "$ref": "#/components/responses/NotFoundError" }, "429": { "$ref": "#/components/responses/RateLimitError" @@ -103376,76 +107066,106 @@ "BearerAuth": [] } ], - "summary": "Create approval set", + "summary": "Get asset set", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "workflows:write" + "assets:read" ] } }, - "/approval-sets/{approval_set_id}": { - "delete": { - "description": "Delete approval set. The server verifies resource ownership and deletion preconditions before removing the resource.", - "operationId": "deleteApprovalSetsApprovalSetId", + "/asset-sets/{asset_set_id}/assets": { + "get": { + "description": "List assets. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdAssets", "parameters": [ { - "description": "The approval set identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "approval_set_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, "type": "integer" } - } - ], - "responses": { - "204": { - "description": "Request completed successfully with no response body." }, - "401": { - "$ref": "#/components/responses/AuthenticationError" + { + "description": "One-based page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } }, - "403": { - "$ref": "#/components/responses/PermissionError" + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } }, - "404": { - "$ref": "#/components/responses/NotFoundError" + { + "description": "Restricts assets by type id.", + "in": "query", + "name": "type_id", + "required": false, + "schema": { + "type": "string" + } }, - "429": { - "$ref": "#/components/responses/RateLimitError" + { + "description": "Restricts assets by category id.", + "in": "query", + "name": "category_id", + "required": false, + "schema": { + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ { - "BearerAuth": [] - } - ], - "summary": "Delete approval set", - "tags": [ - "Governance" - ], - "x-required-scopes": [ - "workflows:write" - ] - }, - "get": { - "description": "Get approval set. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getApprovalSetsApprovalSetId", - "parameters": [ + "description": "Restricts assets by status id.", + "in": "query", + "name": "status_id", + "required": false, + "schema": { + "type": "string" + } + }, { - "description": "The approval set identifier.", - "in": "path", - "name": "approval_set_id", - "required": true, + "description": "Whether category filtering includes descendant categories.", + "in": "query", + "name": "include_subcategories", + "required": false, "schema": { - "minimum": 1, - "type": "integer" + "default": true, + "type": "boolean" + } + }, + { + "description": "Case-insensitive asset text search.", + "in": "query", + "name": "search", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Asset query-language expression applied after structured filters.", + "in": "query", + "name": "ql", + "required": false, + "schema": { + "type": "string" } } ], @@ -103454,11 +107174,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApprovalSetsApprovalSetIdResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdAssetsResult" } } }, - "description": "Get approval set response." + "description": "List assets response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103481,22 +107201,22 @@ "BearerAuth": [] } ], - "summary": "Get approval set", + "summary": "List assets", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "workflows:read" + "assets:read" ] }, - "patch": { - "description": "Patch approval set. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", - "operationId": "patchApprovalSetsApprovalSetId", + "post": { + "description": "Create asset. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAssetSetsAssetSetIdAssets", "parameters": [ { - "description": "The approval set identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "approval_set_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -103506,24 +107226,24 @@ ], "requestBody": { "content": { - "application/merge-patch+json": { + "application/json": { "schema": { - "$ref": "#/components/schemas/PatchApprovalSetsApprovalSetIdPayload" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdAssetsPayload" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchApprovalSetsApprovalSetIdResult" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdAssetsResult" } } }, - "description": "Patch approval set response." + "description": "Create asset response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -103555,20 +107275,30 @@ "BearerAuth": [] } ], - "summary": "Patch approval set", + "summary": "Create asset", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "workflows:write" + "assets:write" ] } }, - "/approvals/mine": { + "/asset-sets/{asset_set_id}/categories": { "get": { - "description": "List my approvals. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getApprovalsMine", + "description": "List asset categories. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdCategories", "parameters": [ + { + "description": "The asset set identifier.", + "in": "path", + "name": "asset_set_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, { "description": "One-based page number.", "in": "query", @@ -103593,12 +107323,13 @@ } }, { - "description": "Restricts approvals to one decision status.", + "description": "Whether to return categories as a hierarchy.", "in": "query", - "name": "status", + "name": "tree", "required": false, "schema": { - "type": "string" + "default": false, + "type": "boolean" } } ], @@ -103607,11 +107338,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApprovalsMineResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdCategoriesResult" } } }, - "description": "List my approvals response." + "description": "List asset categories response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103619,6 +107350,9 @@ "403": { "$ref": "#/components/responses/PermissionError" }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -103631,24 +107365,24 @@ "BearerAuth": [] } ], - "summary": "List my approvals", + "summary": "List asset categories", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:read" + "assets:read" ] } }, - "/approvals/{approval_id}": { + "/asset-sets/{asset_set_id}/everyone-role": { "get": { - "description": "Get approval. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getApprovalsApprovalId", + "description": "Get asset set everyone role. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdEveryoneRole", "parameters": [ { - "description": "The approval identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "approval_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -103661,11 +107395,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetApprovalsApprovalIdResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdEveryoneRoleResult" } } }, - "description": "Get approval response." + "description": "Get asset set everyone role response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103688,24 +107422,24 @@ "BearerAuth": [] } ], - "summary": "Get approval", + "summary": "Get asset set everyone role", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:read" + "assets:read" ] } }, - "/approvals/{approval_id}/cancellation": { + "/asset-sets/{asset_set_id}/import/create-type": { "post": { - "description": "Cancel approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postApprovalsApprovalIdCancellation", + "description": "Create asset import type. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAssetSetsAssetSetIdImportCreateType", "parameters": [ { - "description": "The approval identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "approval_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -103717,22 +107451,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdCancellationPayload" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportCreateTypePayload" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdCancellationResult" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportCreateTypeResult" } } }, - "description": "Cancel approval response." + "description": "Create asset import type response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -103746,9 +107480,6 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, - "409": { - "description": "Approval is no longer pending" - }, "413": { "$ref": "#/components/responses/PayloadTooLargeError" }, @@ -103767,24 +107498,24 @@ "BearerAuth": [] } ], - "summary": "Cancel approval", + "summary": "Create asset import type", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:write" + "assets:write" ] } }, - "/approvals/{approval_id}/decisions": { - "post": { - "description": "Decide approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postApprovalsApprovalIdDecisions", + "/asset-sets/{asset_set_id}/import/jobs": { + "get": { + "description": "List asset import jobs. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdImportJobs", "parameters": [ { - "description": "The approval identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "approval_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -103792,29 +107523,16 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdDecisionsPayload" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdDecisionsResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdImportJobsResult" } } }, - "description": "Decide approval response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "List asset import jobs response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103825,12 +107543,6 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, - "413": { - "$ref": "#/components/responses/PayloadTooLargeError" - }, - "415": { - "$ref": "#/components/responses/UnsupportedMediaTypeError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -103843,24 +107555,34 @@ "BearerAuth": [] } ], - "summary": "Decide approval", + "summary": "List asset import jobs", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:write" + "assets:read" ] } }, - "/approvals/{approval_id}/delegations": { - "post": { - "description": "Delegate approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postApprovalsApprovalIdDelegations", + "/asset-sets/{asset_set_id}/import/jobs/{job_id}": { + "get": { + "description": "Get asset import job. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdImportJobsJobId", "parameters": [ { - "description": "The approval identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "approval_id", + "name": "asset_set_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "The job identifier.", + "in": "path", + "name": "job_id", "required": true, "schema": { "minimum": 1, @@ -103868,29 +107590,16 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdDelegationsPayload" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdDelegationsResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdImportJobsJobIdResult" } } }, - "description": "Delegate approval response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "Get asset import job response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -103901,12 +107610,6 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, - "413": { - "$ref": "#/components/responses/PayloadTooLargeError" - }, - "415": { - "$ref": "#/components/responses/UnsupportedMediaTypeError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -103919,34 +107622,24 @@ "BearerAuth": [] } ], - "summary": "Delegate approval", + "summary": "Get asset import job", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:write" + "assets:read" ] } }, - "/approvals/{approval_id}/steps/{step_id}/approver-refreshes": { + "/asset-sets/{asset_set_id}/import/start": { "post": { - "description": "Refresh approval approvers. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postApprovalsApprovalIdStepsStepIdApproverRefreshes", + "description": "Start asset import. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAssetSetsAssetSetIdImportStart", "parameters": [ { - "description": "The approval identifier.", - "in": "path", - "name": "approval_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "The step identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "step_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -103958,22 +107651,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdStepsStepIdApproverRefreshesPayload" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportStartPayload" } } }, "required": true }, "responses": { - "200": { + "202": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdStepsStepIdApproverRefreshesResult" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportStartResult" } } }, - "description": "Refresh approval approvers response." + "description": "Start asset import response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -104005,34 +107698,24 @@ "BearerAuth": [] } ], - "summary": "Refresh approval approvers", + "summary": "Start asset import", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:write" + "assets:write" ] } }, - "/approvals/{approval_id}/steps/{step_id}/escalations": { + "/asset-sets/{asset_set_id}/import/suggest-fields": { "post": { - "description": "Escalate approval. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postApprovalsApprovalIdStepsStepIdEscalations", + "description": "Suggest asset import fields. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAssetSetsAssetSetIdImportSuggestFields", "parameters": [ { - "description": "The approval identifier.", - "in": "path", - "name": "approval_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "The step identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "step_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -104040,16 +107723,26 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportSuggestFieldsPayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostApprovalsApprovalIdStepsStepIdEscalationsResult" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportSuggestFieldsResult" } } }, - "description": "Escalate approval response." + "description": "Suggest asset import fields response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -104063,6 +107756,12 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -104075,24 +107774,24 @@ "BearerAuth": [] } ], - "summary": "Escalate approval", + "summary": "Suggest asset import fields", "tags": [ - "Governance" + "Asset management" ], "x-required-scopes": [ - "approvals:write" + "assets:write" ] } }, - "/asset-categories/{category_id}": { - "get": { - "description": "Get asset category. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetCategoriesCategoryId", + "/asset-sets/{asset_set_id}/import/upload": { + "post": { + "description": "Upload asset import. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAssetSetsAssetSetIdImportUpload", "parameters": [ { - "description": "The category identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "category_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -104100,16 +107799,29 @@ } } ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportUploadPayload" + } + } + }, + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetCategoriesCategoryIdResult" + "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportUploadResult" } } }, - "description": "Get asset category response." + "description": "Upload asset import response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104120,6 +107832,12 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -104132,30 +107850,41 @@ "BearerAuth": [] } ], - "summary": "Get asset category", + "summary": "Upload asset import", "tags": [ "Asset management" ], "x-required-scopes": [ - "assets:read" + "assets:write" ] } }, - "/asset-roles": { + "/asset-sets/{asset_set_id}/portal-access": { "get": { - "description": "List asset roles. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetRoles", - "parameters": [], + "description": "Get asset set portal access. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdPortalAccess", + "parameters": [ + { + "description": "The asset set identifier.", + "in": "path", + "name": "asset_set_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetRolesResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdPortalAccessResult" } } }, - "description": "List asset roles response." + "description": "Get asset set portal access response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104163,6 +107892,9 @@ "403": { "$ref": "#/components/responses/PermissionError" }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -104175,7 +107907,7 @@ "BearerAuth": [] } ], - "summary": "List asset roles", + "summary": "Get asset set portal access", "tags": [ "Asset management" ], @@ -104184,15 +107916,15 @@ ] } }, - "/asset-roles/{role_id}": { + "/asset-sets/{asset_set_id}/roles": { "get": { - "description": "Get asset role. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetRolesRoleId", + "description": "List asset set roles. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdRoles", "parameters": [ { - "description": "The role identifier.", + "description": "The asset set identifier.", "in": "path", - "name": "role_id", + "name": "asset_set_id", "required": true, "schema": { "minimum": 1, @@ -104205,11 +107937,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetRolesRoleIdResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdRolesResult" } } }, - "description": "Get asset role response." + "description": "List asset set roles response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104232,7 +107964,7 @@ "BearerAuth": [] } ], - "summary": "Get asset role", + "summary": "List asset set roles", "tags": [ "Asset management" ], @@ -104241,11 +107973,21 @@ ] } }, - "/asset-sets": { + "/asset-sets/{asset_set_id}/statuses": { "get": { - "description": "List asset sets. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSets", + "description": "List asset statuses. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdStatuses", "parameters": [ + { + "description": "The asset set identifier.", + "in": "path", + "name": "asset_set_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, { "description": "One-based page number.", "in": "query", @@ -104275,65 +108017,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsResult" - } - } - }, - "description": "List asset sets response." - }, - "401": { - "$ref": "#/components/responses/AuthenticationError" - }, - "403": { - "$ref": "#/components/responses/PermissionError" - }, - "429": { - "$ref": "#/components/responses/RateLimitError" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "List asset sets", - "tags": [ - "Asset management" - ], - "x-required-scopes": [ - "assets:read" - ] - } - }, - "/asset-sets/{asset_set_id}": { - "get": { - "description": "Get asset set. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetId", - "parameters": [ - { - "description": "The asset set identifier.", - "in": "path", - "name": "asset_set_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdStatusesResult" } } }, - "description": "Get asset set response." + "description": "List asset statuses response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104356,7 +108044,7 @@ "BearerAuth": [] } ], - "summary": "Get asset set", + "summary": "List asset statuses", "tags": [ "Asset management" ], @@ -104365,10 +108053,10 @@ ] } }, - "/asset-sets/{asset_set_id}/assets": { + "/asset-sets/{asset_set_id}/types": { "get": { - "description": "List assets. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdAssets", + "description": "List asset types. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetSetsAssetSetIdTypes", "parameters": [ { "description": "The asset set identifier.", @@ -104402,61 +108090,6 @@ "minimum": 1, "type": "integer" } - }, - { - "description": "Restricts assets by type id.", - "in": "query", - "name": "type_id", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Restricts assets by category id.", - "in": "query", - "name": "category_id", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Restricts assets by status id.", - "in": "query", - "name": "status_id", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Whether category filtering includes descendant categories.", - "in": "query", - "name": "include_subcategories", - "required": false, - "schema": { - "default": true, - "type": "boolean" - } - }, - { - "description": "Case-insensitive asset text search.", - "in": "query", - "name": "search", - "required": false, - "schema": { - "type": "string" - } - }, - { - "description": "Asset query-language expression applied after structured filters.", - "in": "query", - "name": "ql", - "required": false, - "schema": { - "type": "string" - } } ], "responses": { @@ -104464,11 +108097,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdAssetsResult" + "$ref": "#/components/schemas/GetAssetSetsAssetSetIdTypesResult" } } }, - "description": "List assets response." + "description": "List asset types response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104491,22 +108124,24 @@ "BearerAuth": [] } ], - "summary": "List assets", + "summary": "List asset types", "tags": [ "Asset management" ], "x-required-scopes": [ "assets:read" ] - }, - "post": { - "description": "Create asset. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAssetSetsAssetSetIdAssets", + } + }, + "/asset-statuses/{status_id}": { + "get": { + "description": "Get asset status. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetStatusesStatusId", "parameters": [ { - "description": "The asset set identifier.", + "description": "The status identifier.", "in": "path", - "name": "asset_set_id", + "name": "status_id", "required": true, "schema": { "minimum": 1, @@ -104514,29 +108149,16 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdAssetsPayload" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdAssetsResult" + "$ref": "#/components/schemas/GetAssetStatusesStatusIdResult" } } }, - "description": "Create asset response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "Get asset status response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104547,12 +108169,6 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, - "413": { - "$ref": "#/components/responses/PayloadTooLargeError" - }, - "415": { - "$ref": "#/components/responses/UnsupportedMediaTypeError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -104565,62 +108181,29 @@ "BearerAuth": [] } ], - "summary": "Create asset", + "summary": "Get asset status", "tags": [ "Asset management" ], "x-required-scopes": [ - "assets:write" + "assets:read" ] } }, - "/asset-sets/{asset_set_id}/categories": { + "/asset-types/{asset_type_id}": { "get": { - "description": "List asset categories. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdCategories", + "description": "Get asset type. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetTypesAssetTypeId", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset type identifier.", "in": "path", - "name": "asset_set_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "One-based page number.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Maximum number of resources to return.", - "in": "query", - "name": "page_size", - "required": false, + "name": "asset_type_id", + "required": true, "schema": { - "default": 50, - "maximum": 1000, "minimum": 1, "type": "integer" } - }, - { - "description": "Whether to return categories as a hierarchy.", - "in": "query", - "name": "tree", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } } ], "responses": { @@ -104628,11 +108211,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdCategoriesResult" + "$ref": "#/components/schemas/GetAssetTypesAssetTypeIdResult" } } }, - "description": "List asset categories response." + "description": "Get asset type response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104655,7 +108238,7 @@ "BearerAuth": [] } ], - "summary": "List asset categories", + "summary": "Get asset type", "tags": [ "Asset management" ], @@ -104664,15 +108247,15 @@ ] } }, - "/asset-sets/{asset_set_id}/everyone-role": { + "/asset-types/{asset_type_id}/fields": { "get": { - "description": "Get asset set everyone role. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdEveryoneRole", + "description": "List asset type fields. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetTypesAssetTypeIdFields", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset type identifier.", "in": "path", - "name": "asset_set_id", + "name": "asset_type_id", "required": true, "schema": { "minimum": 1, @@ -104685,11 +108268,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdEveryoneRoleResult" + "$ref": "#/components/schemas/GetAssetTypesAssetTypeIdFieldsResult" } } }, - "description": "Get asset set everyone role response." + "description": "List asset type fields response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104712,7 +108295,7 @@ "BearerAuth": [] } ], - "summary": "Get asset set everyone role", + "summary": "List asset type fields", "tags": [ "Asset management" ], @@ -104721,42 +108304,31 @@ ] } }, - "/asset-sets/{asset_set_id}/import/create-type": { + "/assets/summaries": { "post": { - "description": "Create asset import type. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAssetSetsAssetSetIdImportCreateType", - "parameters": [ - { - "description": "The asset set identifier.", - "in": "path", - "name": "asset_set_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - } - ], + "description": "Returns a bounded projection for up to 500 IDs. IDs are deduplicated by first occurrence; visible matches preserve request order, and missing or unauthorized resources are omitted without revealing which case applied. Results reflect committed state at request time and are all-or-nothing on computation failure.", + "operationId": "postAssetsSummaries", + "parameters": [], "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportCreateTypePayload" + "$ref": "#/components/schemas/PostAssetsSummariesPayload" } } }, "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportCreateTypeResult" + "$ref": "#/components/schemas/PostAssetsSummariesResult" } } }, - "description": "Create asset import type response." + "description": "List asset summaries response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -104767,9 +108339,6 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "404": { - "$ref": "#/components/responses/NotFoundError" - }, "413": { "$ref": "#/components/responses/PayloadTooLargeError" }, @@ -104788,24 +108357,24 @@ "BearerAuth": [] } ], - "summary": "Create asset import type", + "summary": "List asset summaries", "tags": [ "Asset management" ], "x-required-scopes": [ - "assets:write" + "assets:read" ] } }, - "/asset-sets/{asset_set_id}/import/jobs": { - "get": { - "description": "List asset import jobs. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdImportJobs", + "/assets/{asset_id}": { + "delete": { + "description": "Delete asset. The server verifies resource ownership and deletion preconditions before removing the resource.", + "operationId": "deleteAssetsAssetId", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset identifier.", "in": "path", - "name": "asset_set_id", + "name": "asset_id", "required": true, "schema": { "minimum": 1, @@ -104814,15 +108383,8 @@ } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdImportJobsResult" - } - } - }, - "description": "List asset import jobs response." + "204": { + "description": "Request completed successfully with no response body." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104845,34 +108407,22 @@ "BearerAuth": [] } ], - "summary": "List asset import jobs", + "summary": "Delete asset", "tags": [ "Asset management" ], "x-required-scopes": [ - "assets:read" + "assets:delete" ] - } - }, - "/asset-sets/{asset_set_id}/import/jobs/{job_id}": { + }, "get": { - "description": "Get asset import job. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdImportJobsJobId", + "description": "Get asset. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetsAssetId", "parameters": [ { - "description": "The asset set identifier.", - "in": "path", - "name": "asset_set_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - }, - { - "description": "The job identifier.", + "description": "The asset identifier.", "in": "path", - "name": "job_id", + "name": "asset_id", "required": true, "schema": { "minimum": 1, @@ -104885,11 +108435,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdImportJobsJobIdResult" + "$ref": "#/components/schemas/GetAssetsAssetIdResult" } } }, - "description": "Get asset import job response." + "description": "Get asset response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -104912,24 +108462,22 @@ "BearerAuth": [] } ], - "summary": "Get asset import job", + "summary": "Get asset", "tags": [ "Asset management" ], "x-required-scopes": [ "assets:read" ] - } - }, - "/asset-sets/{asset_set_id}/import/start": { - "post": { - "description": "Start asset import. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAssetSetsAssetSetIdImportStart", + }, + "patch": { + "description": "Update asset. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", + "operationId": "patchAssetsAssetId", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset identifier.", "in": "path", - "name": "asset_set_id", + "name": "asset_id", "required": true, "schema": { "minimum": 1, @@ -104939,24 +108487,24 @@ ], "requestBody": { "content": { - "application/json": { + "application/merge-patch+json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportStartPayload" + "$ref": "#/components/schemas/PatchAssetsAssetIdPayload" } } }, "required": true }, "responses": { - "202": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportStartResult" + "$ref": "#/components/schemas/PatchAssetsAssetIdResult" } } }, - "description": "Start asset import response." + "description": "Update asset response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -104988,7 +108536,7 @@ "BearerAuth": [] } ], - "summary": "Start asset import", + "summary": "Update asset", "tags": [ "Asset management" ], @@ -104997,15 +108545,15 @@ ] } }, - "/asset-sets/{asset_set_id}/import/suggest-fields": { - "post": { - "description": "Suggest asset import fields. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAssetSetsAssetSetIdImportSuggestFields", + "/assets/{asset_id}/links": { + "get": { + "description": "List asset links. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetsAssetIdLinks", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset identifier.", "in": "path", - "name": "asset_set_id", + "name": "asset_id", "required": true, "schema": { "minimum": 1, @@ -105013,29 +108561,16 @@ } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportSuggestFieldsPayload" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportSuggestFieldsResult" + "$ref": "#/components/schemas/GetAssetsAssetIdLinksResult" } } }, - "description": "Suggest asset import fields response." - }, - "400": { - "$ref": "#/components/responses/InvalidRequestError" + "description": "List asset links response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105046,12 +108581,6 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, - "413": { - "$ref": "#/components/responses/PayloadTooLargeError" - }, - "415": { - "$ref": "#/components/responses/UnsupportedMediaTypeError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -105064,24 +108593,22 @@ "BearerAuth": [] } ], - "summary": "Suggest asset import fields", + "summary": "List asset links", "tags": [ "Asset management" ], "x-required-scopes": [ - "assets:write" + "assets:read" ] - } - }, - "/asset-sets/{asset_set_id}/import/upload": { + }, "post": { - "description": "Upload asset import. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAssetSetsAssetSetIdImportUpload", + "description": "Create asset link. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "operationId": "postAssetsAssetIdLinks", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset identifier.", "in": "path", - "name": "asset_set_id", + "name": "asset_id", "required": true, "schema": { "minimum": 1, @@ -105091,9 +108618,9 @@ ], "requestBody": { "content": { - "multipart/form-data": { + "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportUploadPayload" + "$ref": "#/components/schemas/PostAssetsAssetIdLinksPayload" } } }, @@ -105104,11 +108631,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetSetsAssetSetIdImportUploadResult" + "$ref": "#/components/schemas/PostAssetsAssetIdLinksResult" } } }, - "description": "Upload asset import response." + "description": "Create asset link response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -105140,7 +108667,7 @@ "BearerAuth": [] } ], - "summary": "Upload asset import", + "summary": "Create asset link", "tags": [ "Asset management" ], @@ -105149,15 +108676,15 @@ ] } }, - "/asset-sets/{asset_set_id}/portal-access": { + "/assets/{asset_id}/relationship-graph": { "get": { - "description": "Get asset set portal access. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdPortalAccess", + "description": "Get asset relationship graph. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAssetsAssetIdRelationshipGraph", "parameters": [ { - "description": "The asset set identifier.", + "description": "The asset identifier.", "in": "path", - "name": "asset_set_id", + "name": "asset_id", "required": true, "schema": { "minimum": 1, @@ -105170,11 +108697,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdPortalAccessResult" + "$ref": "#/components/schemas/GetAssetsAssetIdRelationshipGraphResult" } } }, - "description": "Get asset set portal access response." + "description": "Get asset relationship graph response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105197,7 +108724,7 @@ "BearerAuth": [] } ], - "summary": "Get asset set portal access", + "summary": "Get asset relationship graph", "tags": [ "Asset management" ], @@ -105206,15 +108733,15 @@ ] } }, - "/asset-sets/{asset_set_id}/roles": { - "get": { - "description": "List asset set roles. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdRoles", + "/attachments/{attachment_id}": { + "delete": { + "description": "Delete item attachment. The server verifies resource ownership and deletion preconditions before removing the resource.", + "operationId": "deleteAttachmentsAttachmentId", "parameters": [ { - "description": "The asset set identifier.", + "description": "The attachment identifier.", "in": "path", - "name": "asset_set_id", + "name": "attachment_id", "required": true, "schema": { "minimum": 1, @@ -105223,15 +108750,8 @@ } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdRolesResult" - } - } - }, - "description": "List asset set roles response." + "204": { + "description": "Request completed successfully with no response body." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105254,64 +108774,107 @@ "BearerAuth": [] } ], - "summary": "List asset set roles", + "summary": "Delete item attachment", "tags": [ - "Asset management" + "Work items" ], "x-required-scopes": [ - "assets:read" + "items:write" ] - } - }, - "/asset-sets/{asset_set_id}/statuses": { + }, "get": { - "description": "List asset statuses. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdStatuses", + "description": "Get item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAttachmentsAttachmentId", "parameters": [ { - "description": "The asset set identifier.", + "description": "The attachment identifier.", "in": "path", - "name": "asset_set_id", + "name": "attachment_id", "required": true, "schema": { "minimum": 1, "type": "integer" } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetAttachmentsAttachmentIdResult" + } + } + }, + "description": "Get item attachment response." }, - { - "description": "One-based page number.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "type": "integer" - } + "401": { + "$ref": "#/components/responses/AuthenticationError" + }, + "403": { + "$ref": "#/components/responses/PermissionError" + }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "429": { + "$ref": "#/components/responses/RateLimitError" }, + "500": { + "$ref": "#/components/responses/InternalError" + } + }, + "security": [ { - "description": "Maximum number of resources to return.", - "in": "query", - "name": "page_size", - "required": false, + "BearerAuth": [] + } + ], + "summary": "Get item attachment", + "tags": [ + "Work items" + ], + "x-required-scopes": [ + "items:read" + ] + }, + "patch": { + "description": "Update item attachment visibility. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", + "operationId": "patchAttachmentsAttachmentId", + "parameters": [ + { + "description": "The attachment identifier.", + "in": "path", + "name": "attachment_id", + "required": true, "schema": { - "default": 50, - "maximum": 1000, "minimum": 1, "type": "integer" } } ], + "requestBody": { + "content": { + "application/merge-patch+json": { + "schema": { + "$ref": "#/components/schemas/PatchAttachmentsAttachmentIdPayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdStatusesResult" + "$ref": "#/components/schemas/PatchAttachmentsAttachmentIdResult" } } }, - "description": "List asset statuses response." + "description": "Update item attachment visibility response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105322,6 +108885,12 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -105334,64 +108903,41 @@ "BearerAuth": [] } ], - "summary": "List asset statuses", + "summary": "Update item attachment visibility", "tags": [ - "Asset management" + "Work items" ], "x-required-scopes": [ - "assets:read" + "items:write" ] } }, - "/asset-sets/{asset_set_id}/types": { + "/attachments/{attachment_id}/content": { "get": { - "description": "List asset types. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetSetsAssetSetIdTypes", + "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAttachmentsAttachmentIdContent", "parameters": [ { - "description": "The asset set identifier.", + "description": "The attachment identifier.", "in": "path", - "name": "asset_set_id", + "name": "attachment_id", "required": true, "schema": { "minimum": 1, "type": "integer" } - }, - { - "description": "One-based page number.", - "in": "query", - "name": "page", - "required": false, - "schema": { - "default": 1, - "minimum": 1, - "type": "integer" - } - }, - { - "description": "Maximum number of resources to return.", - "in": "query", - "name": "page_size", - "required": false, - "schema": { - "default": 50, - "maximum": 1000, - "minimum": 1, - "type": "integer" - } } ], "responses": { "200": { "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/GetAssetSetsAssetSetIdTypesResult" + "$ref": "#/components/schemas/GetAttachmentsAttachmentIdContentResult" } } }, - "description": "List asset types response." + "description": "Download item attachment response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105414,24 +108960,25 @@ "BearerAuth": [] } ], - "summary": "List asset types", + "summary": "Download item attachment", "tags": [ - "Asset management" + "Work items" ], - "x-required-scopes": [ - "assets:read" + "x-required-any-scopes": [ + "items:read", + "pages:read" ] } }, - "/asset-statuses/{status_id}": { + "/attachments/{attachment_id}/download": { "get": { - "description": "Get asset status. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetStatusesStatusId", + "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAttachmentsAttachmentIdDownload", "parameters": [ { - "description": "The status identifier.", + "description": "The attachment identifier.", "in": "path", - "name": "status_id", + "name": "attachment_id", "required": true, "schema": { "minimum": 1, @@ -105442,13 +108989,13 @@ "responses": { "200": { "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/GetAssetStatusesStatusIdResult" + "$ref": "#/components/schemas/GetAttachmentsAttachmentIdDownloadResult" } } }, - "description": "Get asset status response." + "description": "Download item attachment response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105471,24 +109018,25 @@ "BearerAuth": [] } ], - "summary": "Get asset status", + "summary": "Download item attachment", "tags": [ - "Asset management" + "Work items" ], - "x-required-scopes": [ - "assets:read" + "x-required-any-scopes": [ + "items:read", + "pages:read" ] } }, - "/asset-types/{asset_type_id}": { + "/attachments/{attachment_id}/thumbnail": { "get": { - "description": "Get asset type. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetTypesAssetTypeId", + "description": "Get item attachment thumbnail. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getAttachmentsAttachmentIdThumbnail", "parameters": [ { - "description": "The asset type identifier.", + "description": "The attachment identifier.", "in": "path", - "name": "asset_type_id", + "name": "attachment_id", "required": true, "schema": { "minimum": 1, @@ -105499,13 +109047,13 @@ "responses": { "200": { "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/GetAssetTypesAssetTypeIdResult" + "$ref": "#/components/schemas/GetAttachmentsAttachmentIdThumbnailResult" } } }, - "description": "Get asset type response." + "description": "Get item attachment thumbnail response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105528,97 +109076,132 @@ "BearerAuth": [] } ], - "summary": "Get asset type", + "summary": "Get item attachment thumbnail", "tags": [ - "Asset management" + "Work items" ], - "x-required-scopes": [ - "assets:read" + "x-required-any-scopes": [ + "items:read", + "pages:read" ] } }, - "/asset-types/{asset_type_id}/fields": { + "/board-publications": { "get": { - "description": "List asset type fields. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetTypesAssetTypeIdFields", + "description": "List owned board publications. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "getBoardPublications", "parameters": [ { - "description": "The asset type identifier.", - "in": "path", - "name": "asset_type_id", - "required": true, + "description": "One-based page number.", + "in": "query", + "name": "page", + "required": false, + "schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Maximum number of resources to return.", + "in": "query", + "name": "page_size", + "required": false, + "schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Case-insensitive board name or slug substring.", + "in": "query", + "name": "q", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Restricts publication metadata to this resource.", + "in": "query", + "name": "workspace_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Restricts publication metadata to this resource.", + "in": "query", + "name": "owner_id", + "required": false, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Restricts publication metadata to this resource.", + "in": "query", + "name": "organisation_id", + "required": false, "schema": { "minimum": 1, "type": "integer" } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetAssetTypesAssetTypeIdFieldsResult" - } - } - }, - "description": "List asset type fields response." }, - "401": { - "$ref": "#/components/responses/AuthenticationError" - }, - "403": { - "$ref": "#/components/responses/PermissionError" - }, - "404": { - "$ref": "#/components/responses/NotFoundError" + { + "description": "Only globally scoped collections.", + "in": "query", + "name": "global", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } }, - "429": { - "$ref": "#/components/responses/RateLimitError" + { + "description": "Publication state.", + "in": "query", + "name": "state", + "required": false, + "schema": { + "enum": [ + "all", + "enabled", + "disabled", + "revoked" + ], + "type": "string" + } }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ { - "BearerAuth": [] + "description": "Board baseline audience mode.", + "in": "query", + "name": "access_mode", + "required": false, + "schema": { + "enum": [ + "public", + "organisations" + ], + "type": "string" + } } ], - "summary": "List asset type fields", - "tags": [ - "Asset management" - ], - "x-required-scopes": [ - "assets:read" - ] - } - }, - "/assets/summaries": { - "post": { - "description": "Returns a bounded projection for up to 500 IDs. IDs are deduplicated by first occurrence; visible matches preserve request order, and missing or unauthorized resources are omitted without revealing which case applied. Results reflect committed state at request time and are all-or-nothing on computation failure.", - "operationId": "postAssetsSummaries", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PostAssetsSummariesPayload" - } - } - }, - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetsSummariesResult" + "$ref": "#/components/schemas/GetBoardPublicationsResult" } } }, - "description": "List asset summaries response." + "description": "List owned board publications response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -105629,11 +109212,8 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "413": { - "$ref": "#/components/responses/PayloadTooLargeError" - }, - "415": { - "$ref": "#/components/responses/UnsupportedMediaTypeError" + "404": { + "$ref": "#/components/responses/NotFoundError" }, "429": { "$ref": "#/components/responses/RateLimitError" @@ -105647,24 +109227,24 @@ "BearerAuth": [] } ], - "summary": "List asset summaries", + "summary": "List owned board publications", "tags": [ - "Asset management" + "Governance" ], "x-required-scopes": [ - "assets:read" + "collections:read" ] } }, - "/assets/{asset_id}": { - "delete": { - "description": "Delete asset. The server verifies resource ownership and deletion preconditions before removing the resource.", - "operationId": "deleteAssetsAssetId", + "/board-publications/{collection_id}": { + "get": { + "description": "Read board sharing settings. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "getBoardPublicationsCollectionId", "parameters": [ { - "description": "The asset identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "asset_id", + "name": "collection_id", "required": true, "schema": { "minimum": 1, @@ -105673,8 +109253,18 @@ } ], "responses": { - "204": { - "description": "Request completed successfully with no response body." + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetBoardPublicationsCollectionIdResult" + } + } + }, + "description": "Read board sharing settings response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105697,22 +109287,22 @@ "BearerAuth": [] } ], - "summary": "Delete asset", + "summary": "Read board sharing settings", "tags": [ - "Asset management" + "Governance" ], "x-required-scopes": [ - "assets:delete" + "collections:read" ] }, - "get": { - "description": "Get asset. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetsAssetId", + "put": { + "description": "Save board publication and audience atomically. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "putBoardPublicationsCollectionId", "parameters": [ { - "description": "The asset identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "asset_id", + "name": "collection_id", "required": true, "schema": { "minimum": 1, @@ -105720,16 +109310,29 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutBoardPublicationsCollectionIdPayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetsAssetIdResult" + "$ref": "#/components/schemas/PutBoardPublicationsCollectionIdResult" } } }, - "description": "Get asset response." + "description": "Save board publication and audience atomically response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105740,6 +109343,15 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -105752,22 +109364,24 @@ "BearerAuth": [] } ], - "summary": "Get asset", + "summary": "Save board publication and audience atomically", "tags": [ - "Asset management" + "Governance" ], "x-required-scopes": [ - "assets:read" + "collections:write" ] - }, - "patch": { - "description": "Update asset. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", - "operationId": "patchAssetsAssetId", + } + }, + "/board-publications/{collection_id}/allow-republish": { + "post": { + "description": "Clear a publication lock without republishing. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "postBoardPublicationsCollectionIdAllowRepublish", "parameters": [ { - "description": "The asset identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "asset_id", + "name": "collection_id", "required": true, "schema": { "minimum": 1, @@ -105777,9 +109391,9 @@ ], "requestBody": { "content": { - "application/merge-patch+json": { + "application/json": { "schema": { - "$ref": "#/components/schemas/PatchAssetsAssetIdPayload" + "$ref": "#/components/schemas/PostBoardPublicationsCollectionIdAllowRepublishPayload" } } }, @@ -105790,11 +109404,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchAssetsAssetIdResult" + "$ref": "#/components/schemas/PostBoardPublicationsCollectionIdAllowRepublishResult" } } }, - "description": "Update asset response." + "description": "Clear a publication lock without republishing response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -105808,6 +109422,9 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, "413": { "$ref": "#/components/responses/PayloadTooLargeError" }, @@ -105826,24 +109443,24 @@ "BearerAuth": [] } ], - "summary": "Update asset", + "summary": "Clear a publication lock without republishing", "tags": [ - "Asset management" + "Governance" ], "x-required-scopes": [ - "assets:write" + "collections:write" ] } }, - "/assets/{asset_id}/links": { + "/board-publications/{collection_id}/history": { "get": { - "description": "List asset links. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetsAssetIdLinks", + "description": "Read board sharing and placement audit history. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "getBoardPublicationsCollectionIdHistory", "parameters": [ { - "description": "The asset identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "asset_id", + "name": "collection_id", "required": true, "schema": { "minimum": 1, @@ -105856,11 +109473,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetsAssetIdLinksResult" + "$ref": "#/components/schemas/GetBoardPublicationsCollectionIdHistoryResult" } } }, - "description": "List asset links response." + "description": "Read board sharing and placement audit history response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105883,22 +109503,24 @@ "BearerAuth": [] } ], - "summary": "List asset links", + "summary": "Read board sharing and placement audit history", "tags": [ - "Asset management" + "Governance" ], "x-required-scopes": [ - "assets:read" + "collections:read" ] - }, + } + }, + "/board-publications/{collection_id}/revoke": { "post": { - "description": "Create asset link. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "operationId": "postAssetsAssetIdLinks", + "description": "Revoke and lock a board publication. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "postBoardPublicationsCollectionIdRevoke", "parameters": [ { - "description": "The asset identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "asset_id", + "name": "collection_id", "required": true, "schema": { "minimum": 1, @@ -105910,22 +109532,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetsAssetIdLinksPayload" + "$ref": "#/components/schemas/PostBoardPublicationsCollectionIdRevokePayload" } } }, "required": true }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PostAssetsAssetIdLinksResult" + "$ref": "#/components/schemas/PostBoardPublicationsCollectionIdRevokeResult" } } }, - "description": "Create asset link response." + "description": "Revoke and lock a board publication response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -105939,6 +109561,9 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, "413": { "$ref": "#/components/responses/PayloadTooLargeError" }, @@ -105957,41 +109582,32 @@ "BearerAuth": [] } ], - "summary": "Create asset link", + "summary": "Revoke and lock a board publication", "tags": [ - "Asset management" + "Governance" ], "x-required-scopes": [ - "assets:write" + "collections:write" ] } }, - "/assets/{asset_id}/relationship-graph": { + "/canned-responses/{response_id}": {}, + "/canned-responses/{response_id}/preview": {}, + "/catalogs/global-bootstrap": { "get": { - "description": "Get asset relationship graph. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAssetsAssetIdRelationshipGraph", - "parameters": [ - { - "description": "The asset identifier.", - "in": "path", - "name": "asset_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - } - ], + "description": "Load global reference catalogs. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "operationId": "getCatalogsGlobalBootstrap", + "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAssetsAssetIdRelationshipGraphResult" + "$ref": "#/components/schemas/GetCatalogsGlobalBootstrapResult" } } }, - "description": "Get asset relationship graph response." + "description": "Load global reference catalogs response." }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -105999,9 +109615,6 @@ "403": { "$ref": "#/components/responses/PermissionError" }, - "404": { - "$ref": "#/components/responses/NotFoundError" - }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -106014,72 +109627,26 @@ "BearerAuth": [] } ], - "summary": "Get asset relationship graph", + "summary": "Load global reference catalogs", "tags": [ - "Asset management" + "Workspace configuration" ], "x-required-scopes": [ - "assets:read" + "item-types:read", + "statuses:read", + "priorities:read" ] } }, - "/attachments/{attachment_id}": { - "delete": { - "description": "Delete item attachment. The server verifies resource ownership and deletion preconditions before removing the resource.", - "operationId": "deleteAttachmentsAttachmentId", - "parameters": [ - { - "description": "The attachment identifier.", - "in": "path", - "name": "attachment_id", - "required": true, - "schema": { - "minimum": 1, - "type": "integer" - } - } - ], - "responses": { - "204": { - "description": "Request completed successfully with no response body." - }, - "401": { - "$ref": "#/components/responses/AuthenticationError" - }, - "403": { - "$ref": "#/components/responses/PermissionError" - }, - "404": { - "$ref": "#/components/responses/NotFoundError" - }, - "429": { - "$ref": "#/components/responses/RateLimitError" - }, - "500": { - "$ref": "#/components/responses/InternalError" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Delete item attachment", - "tags": [ - "Work items" - ], - "x-required-scopes": [ - "items:write" - ] - }, + "/channels/{channel_id}/board-placements": { "get": { - "description": "Get item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAttachmentsAttachmentId", + "description": "List linked board placements and effective audiences. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "getChannelsChannelIdBoardPlacements", "parameters": [ { - "description": "The attachment identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "attachment_id", + "name": "channel_id", "required": true, "schema": { "minimum": 1, @@ -106092,11 +109659,14 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetAttachmentsAttachmentIdResult" + "$ref": "#/components/schemas/GetChannelsChannelIdBoardPlacementsResult" } } }, - "description": "Get item attachment response." + "description": "List linked board placements and effective audiences response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -106119,22 +109689,22 @@ "BearerAuth": [] } ], - "summary": "Get item attachment", + "summary": "List linked board placements and effective audiences", "tags": [ - "Work items" + "Administration" ], "x-required-scopes": [ - "items:read" + "collections:read" ] }, - "patch": { - "description": "Update item attachment visibility. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", - "operationId": "patchAttachmentsAttachmentId", + "post": { + "description": "Link a board publication to a portal. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "postChannelsChannelIdBoardPlacements", "parameters": [ { - "description": "The attachment identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "attachment_id", + "name": "channel_id", "required": true, "schema": { "minimum": 1, @@ -106144,24 +109714,24 @@ ], "requestBody": { "content": { - "application/merge-patch+json": { + "application/json": { "schema": { - "$ref": "#/components/schemas/PatchAttachmentsAttachmentIdPayload" + "$ref": "#/components/schemas/PostChannelsChannelIdBoardPlacementsPayload" } } }, "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PatchAttachmentsAttachmentIdResult" + "$ref": "#/components/schemas/PostChannelsChannelIdBoardPlacementsResult" } } }, - "description": "Update item attachment visibility response." + "description": "Link a board publication to a portal response." }, "400": { "$ref": "#/components/responses/InvalidRequestError" @@ -106175,6 +109745,9 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, "413": { "$ref": "#/components/responses/PayloadTooLargeError" }, @@ -106193,24 +109766,44 @@ "BearerAuth": [] } ], - "summary": "Update item attachment visibility", + "summary": "Link a board publication to a portal", "tags": [ - "Work items" + "Administration" ], "x-required-scopes": [ - "items:write" + "collections:write" ] } }, - "/attachments/{attachment_id}/content": { - "get": { - "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAttachmentsAttachmentIdContent", + "/channels/{channel_id}/board-placements/{placement_id}": { + "delete": { + "description": "Unlink a portal board without deleting its source. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "deleteChannelsChannelIdBoardPlacementsPlacementId", "parameters": [ { - "description": "The attachment identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "attachment_id", + "name": "channel_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Resource key resolved within the requested context.", + "in": "path", + "name": "placement_id", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } + }, + { + "description": "Current placement revision; stale revisions return 409.", + "in": "query", + "name": "revision", "required": true, "schema": { "minimum": 1, @@ -106219,15 +109812,11 @@ } ], "responses": { - "200": { - "content": { - "application/octet-stream": { - "schema": { - "$ref": "#/components/schemas/GetAttachmentsAttachmentIdContentResult" - } - } - }, - "description": "Download item attachment response." + "204": { + "description": "Request completed successfully with no response body." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -106238,6 +109827,15 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -106250,42 +109848,62 @@ "BearerAuth": [] } ], - "summary": "Download item attachment", + "summary": "Unlink a portal board without deleting its source", "tags": [ - "Work items" + "Administration" ], - "x-required-any-scopes": [ - "items:read", - "pages:read" + "x-required-scopes": [ + "collections:write" ] - } - }, - "/attachments/{attachment_id}/download": { - "get": { - "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAttachmentsAttachmentIdDownload", + }, + "put": { + "description": "Update a portal board placement. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "putChannelsChannelIdBoardPlacementsPlacementId", "parameters": [ { - "description": "The attachment identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "attachment_id", + "name": "channel_id", "required": true, "schema": { "minimum": 1, "type": "integer" } + }, + { + "description": "Resource key resolved within the requested context.", + "in": "path", + "name": "placement_id", + "required": true, + "schema": { + "minLength": 1, + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutChannelsChannelIdBoardPlacementsPlacementIdPayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { - "application/octet-stream": { + "application/json": { "schema": { - "$ref": "#/components/schemas/GetAttachmentsAttachmentIdDownloadResult" + "$ref": "#/components/schemas/PutChannelsChannelIdBoardPlacementsPlacementIdResult" } } }, - "description": "Download item attachment response." + "description": "Update a portal board placement response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -106296,6 +109914,15 @@ "404": { "$ref": "#/components/responses/NotFoundError" }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -106308,25 +109935,24 @@ "BearerAuth": [] } ], - "summary": "Download item attachment", + "summary": "Update a portal board placement", "tags": [ - "Work items" + "Administration" ], - "x-required-any-scopes": [ - "items:read", - "pages:read" + "x-required-scopes": [ + "collections:write" ] } }, - "/attachments/{attachment_id}/thumbnail": { + "/channels/{channel_id}/experience": { "get": { - "description": "Get item attachment thumbnail. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getAttachmentsAttachmentIdThumbnail", + "description": "Read portal presentation and capability settings. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "getChannelsChannelIdExperience", "parameters": [ { - "description": "The attachment identifier.", + "description": "Positive numeric resource identifier.", "in": "path", - "name": "attachment_id", + "name": "channel_id", "required": true, "schema": { "minimum": 1, @@ -106337,13 +109963,16 @@ "responses": { "200": { "content": { - "application/octet-stream": { + "application/json": { "schema": { - "$ref": "#/components/schemas/GetAttachmentsAttachmentIdThumbnailResult" + "$ref": "#/components/schemas/GetChannelsChannelIdExperienceResult" } } }, - "description": "Get item attachment thumbnail response." + "description": "Read portal presentation and capability settings response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -106366,33 +109995,52 @@ "BearerAuth": [] } ], - "summary": "Get item attachment thumbnail", + "summary": "Read portal presentation and capability settings", "tags": [ - "Work items" + "Administration" ], - "x-required-any-scopes": [ - "items:read", - "pages:read" + "x-required-scopes": [ + "collections:read" ] - } - }, - "/canned-responses/{response_id}": {}, - "/canned-responses/{response_id}/preview": {}, - "/catalogs/global-bootstrap": { - "get": { - "description": "Load global reference catalogs. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "operationId": "getCatalogsGlobalBootstrap", - "parameters": [], + }, + "put": { + "description": "Save revisioned portal experience settings. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "operationId": "putChannelsChannelIdExperience", + "parameters": [ + { + "description": "Positive numeric resource identifier.", + "in": "path", + "name": "channel_id", + "required": true, + "schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PutChannelsChannelIdExperiencePayload" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetCatalogsGlobalBootstrapResult" + "$ref": "#/components/schemas/PutChannelsChannelIdExperienceResult" } } }, - "description": "Load global reference catalogs response." + "description": "Save revisioned portal experience settings response." + }, + "400": { + "$ref": "#/components/responses/InvalidRequestError" }, "401": { "$ref": "#/components/responses/AuthenticationError" @@ -106400,6 +110048,18 @@ "403": { "$ref": "#/components/responses/PermissionError" }, + "404": { + "$ref": "#/components/responses/NotFoundError" + }, + "409": { + "$ref": "#/components/responses/ConflictError" + }, + "413": { + "$ref": "#/components/responses/PayloadTooLargeError" + }, + "415": { + "$ref": "#/components/responses/UnsupportedMediaTypeError" + }, "429": { "$ref": "#/components/responses/RateLimitError" }, @@ -106412,14 +110072,12 @@ "BearerAuth": [] } ], - "summary": "Load global reference catalogs", + "summary": "Save revisioned portal experience settings", "tags": [ - "Workspace configuration" + "Administration" ], "x-required-scopes": [ - "item-types:read", - "statuses:read", - "priorities:read" + "collections:write" ] } }, diff --git a/frontend/src/lib/api/boardPublications.js b/frontend/src/lib/api/boardPublications.js new file mode 100644 index 000000000..0768edba8 --- /dev/null +++ b/frontend/src/lib/api/boardPublications.js @@ -0,0 +1,34 @@ +import { withCollectionInvalidation } from '../utils/collectionChanges.js'; +import { fetchAPIV2, fetchV2Data } from './core.js'; + +export const boardPublications = { + /** @param {Record} filters + * @param {{admin?: boolean, signal?: AbortSignal}} options */ + list(filters = {}, { admin = false, ...options } = {}) { + const query = new URLSearchParams(); + for (const [key, value] of Object.entries(filters)) { + if (value !== '' && value != null) query.set(key, String(value)); + } + return fetchAPIV2(`${admin ? '/admin' : ''}/board-publications?${query}`, options); + }, + get: (id, options = {}) => fetchV2Data(`/board-publications/${id}`, options), + history: (id, options = {}) => fetchV2Data(`/board-publications/${id}/history`, options), + save: (id, draft) => + withCollectionInvalidation( + fetchV2Data(`/board-publications/${id}`, { method: 'PUT', body: JSON.stringify(draft) }) + ), + revoke: (id, revision, reason) => + withCollectionInvalidation( + fetchV2Data(`/board-publications/${id}/revoke`, { + method: 'POST', + body: JSON.stringify({ revision, reason }), + }) + ), + allowRepublish: (id, revision) => + withCollectionInvalidation( + fetchV2Data(`/board-publications/${id}/allow-republish`, { + method: 'POST', + body: JSON.stringify({ revision }), + }) + ), +}; diff --git a/frontend/src/lib/api/portalBoards.js b/frontend/src/lib/api/portalBoards.js new file mode 100644 index 000000000..3cdaf0ed4 --- /dev/null +++ b/frontend/src/lib/api/portalBoards.js @@ -0,0 +1,28 @@ +import { fetchAPIV2, fetchV2Data } from './core.js'; + +export const portalBoards = { + experience: (slug, options = {}) => + fetchAPIV2(`/portal/${encodeURIComponent(slug)}/experience`, options), + list: (channelId) => fetchV2Data(`/channels/${channelId}/board-placements`), + save: (channelId, placement) => + fetchV2Data( + `/channels/${channelId}/board-placements${placement.id ? `/${encodeURIComponent(placement.id)}` : ''}`, + { + method: placement.id ? 'PUT' : 'POST', + body: JSON.stringify(placement), + } + ), + remove: (channelId, placement) => + fetchV2Data( + `/channels/${channelId}/board-placements/${encodeURIComponent(placement.id)}?revision=${placement.revision}`, + { method: 'DELETE' } + ), + client(slug, placementId) { + const path = `/portal/${encodeURIComponent(slug)}/boards/${encodeURIComponent(placementId)}`; + return { + get: (_slug, options = {}) => fetchAPIV2(path, options), + getItem: (_slug, key, options = {}) => + fetchAPIV2(`${path}/items/${encodeURIComponent(key)}`, options), + }; + }, +}; diff --git a/frontend/src/lib/customer/CompactKnowledge.svelte b/frontend/src/lib/customer/CompactKnowledge.svelte new file mode 100644 index 000000000..2e07be044 --- /dev/null +++ b/frontend/src/lib/customer/CompactKnowledge.svelte @@ -0,0 +1,45 @@ + + +
+ portalSearchStore.searchDebounced()} + on_keydown={event => { if (event.key === 'Enter') portalSearchStore.search(); }} + /> + {#if portalSearchStore.visible} + {#if portalSearchStore.loading} + {:else if portalSearchStore.error} + {:else} +
+ {#each portalSearchStore.results?.data || [] as result} + +

{result.title}

+

{(result.highlight || result.excerpt || '').replace(/<[^>]*>/g, '')}

+ + {:else}{/each} +
+ {/if} + {:else if portalStore.knowledgeBasePageSources.length} + + {:else if external.shareID} + Open knowledge base + {:else}{/if} +
diff --git a/frontend/src/lib/customer/CompactPortal.svelte b/frontend/src/lib/customer/CompactPortal.svelte new file mode 100644 index 000000000..b65f733db --- /dev/null +++ b/frontend/src/lib/customer/CompactPortal.svelte @@ -0,0 +1,74 @@ + + + { if (event.target === window) refreshIdentity(); }} /> + +
+ + {#snippet actions()} + + {#if experience.modules.includes('forms') && active === 'requests'}{/if} + {#if experience.is_internal} + {:else if !experience.authenticated} + {:else}{/if} + {/snippet} + + {#if accessError}{/if} + {#if showLogin && loginStatus}{/if} +
+ {#if !active} + {:else if !moduleEnabled} + {:else if placementId} + {#key `${slug}:${placementId}:${experience.identity_key}:${experience.revision}`} { accessError = status; if (status === 401) void signIn(); } }} />{/key} + {:else} + {#key `${slug}:${active}:${target.formId || ''}:${target.articleId || ''}:${experience.identity_key}:${experience.revision}:${$currentRoute.path}:${$currentRoute.query?.id || ''}`} { rejectedDefault = experience.default_module; } : null }} />{/key} + {/if} +
+
diff --git a/frontend/src/lib/customer/CompactPortalModule.svelte b/frontend/src/lib/customer/CompactPortalModule.svelte new file mode 100644 index 000000000..62fda9d70 --- /dev/null +++ b/frontend/src/lib/customer/CompactPortalModule.svelte @@ -0,0 +1,81 @@ + + +
+ {#if error}{/if} + {#if !ready}{:else if $portalAuthStore.isAuthenticated} + {#if kind === 'forms'} +

New request

+
{#each portalCatalogStore.requestTypes as form (form.id)}{/each}
+ {:else if loaders[kind]} + navigate(`/portal/${slug}/request/${requestType.id}`) } : kind === 'asset-reports' ? { onOpenAssetReportForm: report => selectedReport = report, onOpenRequestForm: form => navigate(`/portal/${slug}/request/${form.id}`) } : {}} /> + {/if} + {/if} + { await onidentitychange?.(); if (!disposed) await load(); }} /> + {#if selectedForm} + navigate(`/portal/${slug}?view=requests&id=${id}`), onclose: () => { selectedForm = null; navigate(`/portal/${slug}?module=forms&choose=1`); } }} /> + {/if} + {#if selectedReport} selectedReport = null }} />{/if} +
diff --git a/frontend/src/lib/customer/CustomerBoundary.svelte b/frontend/src/lib/customer/CustomerBoundary.svelte index c8e727d7c..55a09c2b5 100644 --- a/frontend/src/lib/customer/CustomerBoundary.svelte +++ b/frontend/src/lib/customer/CustomerBoundary.svelte @@ -4,6 +4,8 @@ import CustomerLogin from './CustomerLogin.svelte'; import Button from '../components/Button.svelte'; import AlertBox from '../components/AlertBox.svelte'; + import { navigate } from '../router.js'; + import { toLogical } from '../runtime/contextPath.js'; let { kind, slug, children } = $props(); let status = $state(null); let loading = $state(true); @@ -34,8 +36,11 @@ if (type === 'portal' && portalToken) { const access = await customerAccess.status(type, key); if (access.restricted && !access.allowed) { + const destination = new URLSearchParams(window.location.hash.slice(1)).get('next'); + const next = destination ? toLogical(destination) : null; await portalAuth.verifyMagicLink(key, portalToken); - history.replaceState(null, '', window.location.pathname); + const root = `/portal/${key}`; + navigate(next && (next === root || next.startsWith(`${root}/`) || next.startsWith(`${root}?`)) ? next : root, { replace: true }); } } const result = await customerAccess.status(type, key); diff --git a/frontend/src/lib/customer/CustomerHeader.svelte b/frontend/src/lib/customer/CustomerHeader.svelte new file mode 100644 index 000000000..8ad80e6db --- /dev/null +++ b/frontend/src/lib/customer/CustomerHeader.svelte @@ -0,0 +1,27 @@ + + +
+
+ {#if logo}{/if} +

{title}

{#if description}

{description}

{/if}
+
+ {#if navigation.length > 1} + + {/if} +
+ {#if actions}{@render actions()}{/if} +
+
diff --git a/frontend/src/lib/customer/CustomerLogin.svelte b/frontend/src/lib/customer/CustomerLogin.svelte index fc0c1bede..564a5871a 100644 --- a/frontend/src/lib/customer/CustomerLogin.svelte +++ b/frontend/src/lib/customer/CustomerLogin.svelte @@ -5,6 +5,7 @@ import Button from '../components/Button.svelte'; import Input from '../components/Input.svelte'; import AlertBox from '../components/AlertBox.svelte'; + import { toLogical } from '../runtime/contextPath.js'; let { kind, slug, status, onlogin } = $props(); let email = $state(''); let busy = $state(false); @@ -15,7 +16,7 @@ event.preventDefault(); busy = true; error = ''; - try { message = (await customerAccess.login(kind, slug, 'request', { email })).message; } + try { message = (await customerAccess.login(kind, slug, 'request', { email, ...(kind === 'portal' ? { next: toLogical(window.location.pathname + window.location.search) } : {}) })).message; } catch (err) { error = err.message; } finally { busy = false; } } diff --git a/frontend/src/lib/customer/CustomerPolicyFields.svelte b/frontend/src/lib/customer/CustomerPolicyFields.svelte new file mode 100644 index 000000000..c8cce4097 --- /dev/null +++ b/frontend/src/lib/customer/CustomerPolicyFields.svelte @@ -0,0 +1,26 @@ + + +
+ + {#if policy.mode === 'organisations'} + {#each policy.organisation_ids as id, index (index)} +
+
policy.organisation_ids = policy.organisation_ids.map((value, i) => i === index ? item?.id ?? null : value)} />
+ +
+ {/each} + + + {#if policy.organisation_ids.length === 0}{/if} + {/if} +
diff --git a/frontend/src/lib/customer/CustomerPortal.svelte b/frontend/src/lib/customer/CustomerPortal.svelte index 2dcf28870..b74eaf14c 100644 --- a/frontend/src/lib/customer/CustomerPortal.svelte +++ b/frontend/src/lib/customer/CustomerPortal.svelte @@ -1,6 +1,6 @@ - + diff --git a/frontend/src/lib/customer/PortalExperience.svelte b/frontend/src/lib/customer/PortalExperience.svelte new file mode 100644 index 000000000..28a2cff07 --- /dev/null +++ b/frontend/src/lib/customer/PortalExperience.svelte @@ -0,0 +1,25 @@ + +{#if error}{:else if !experience}{:else if experience.presentation === 'compact' && !$currentRoute.path.endsWith('/verify')}{:else}{/if} diff --git a/frontend/src/lib/customer/compactNavigation.js b/frontend/src/lib/customer/compactNavigation.js new file mode 100644 index 000000000..dfc8848e1 --- /dev/null +++ b/frontend/src/lib/customer/compactNavigation.js @@ -0,0 +1,54 @@ +const labels = { + requests: 'My requests', + forms: 'New request', + 'knowledge-base': 'Help', + drafts: 'Drafts', + approvals: 'Approvals', + profile: 'Profile', + 'asset-reports': 'Reports', +}; + +export function compactModules(experience) { + const root = `/portal/${experience.slug}`; + const items = experience.modules.includes('boards') + ? experience.boards.map((board) => ({ + id: `board:${board.id}`, + label: board.label, + href: `${root}/boards/${board.id}`, + })) + : []; + for (const kind of experience.modules) { + if ( + !labels[kind] || + (['drafts', 'approvals', 'profile'].includes(kind) && !experience.authenticated) + ) + continue; + items.push({ + id: kind, + label: labels[kind], + href: `${root}${kind === 'knowledge-base' ? '/kb' : kind === 'profile' ? '/profile' : `?module=${kind}`}`, + }); + } + const order = experience.navigation || []; + const rank = (id) => (order.indexOf(id) < 0 ? order.length : order.indexOf(id)); + return items.sort((a, b) => rank(a.id) - rank(b.id)); +} + +export function compactTarget(experience, route, modules) { + const params = route.params || {}; + const query = route.query || {}; + if (params.placementId) return { kind: `board:${params.placementId}` }; + if (params.pageId) return { kind: 'knowledge-base', articleId: Number(params.pageId) }; + if (route.path.includes('/kb')) return { kind: 'knowledge-base' }; + if (route.path.endsWith('/profile')) return { kind: 'profile' }; + if (params.requestTypeId) return { kind: 'forms', formId: Number(params.requestTypeId) }; + if (query.module || ['requests', 'approvals', 'drafts'].includes(query.view)) + return { kind: query.module || query.view }; + const fallback = { kind: modules[0]?.id }; + const configured = experience.default_module || ''; + if (/^form:\d+$/.test(configured) && modules.some((item) => item.id === 'forms')) + return { kind: 'forms', formId: Number(configured.slice(5)) }; + if (/^article:\d+$/.test(configured) && modules.some((item) => item.id === 'knowledge-base')) + return { kind: 'knowledge-base', articleId: Number(configured.slice(8)) }; + return modules.some((item) => item.id === configured) ? { kind: configured } : fallback; +} diff --git a/frontend/src/lib/dialogs/ChannelConfigModal.svelte b/frontend/src/lib/dialogs/ChannelConfigModal.svelte index e2023cbc3..62658445c 100644 --- a/frontend/src/lib/dialogs/ChannelConfigModal.svelte +++ b/frontend/src/lib/dialogs/ChannelConfigModal.svelte @@ -68,7 +68,11 @@ title: '', description: '', registration_mode: 'open', - allowed_domains: '' + allowed_domains: '', + presentation: 'classic', + modules: null, + navigation: [], + default_module: '', }); // Webhook configuration form data @@ -217,6 +221,10 @@ title: config.portal_title || '', description: config.portal_description || '', registration_mode: config.portal_registration_mode === 'manual' ? 'manual' : 'open', + presentation: config.portal_presentation || 'classic', + modules: config.portal_modules ?? null, + navigation: config.portal_navigation || [], + default_module: config.portal_default_module || '', allowed_domains: Array.isArray(config.portal_allowed_domains) ? config.portal_allowed_domains.join(', ') : '' @@ -635,6 +643,7 @@ diff --git a/frontend/src/lib/dialogs/RequestFormModal.svelte b/frontend/src/lib/dialogs/RequestFormModal.svelte index 4abb39617..3f4ecb578 100644 --- a/frontend/src/lib/dialogs/RequestFormModal.svelte +++ b/frontend/src/lib/dialogs/RequestFormModal.svelte @@ -31,6 +31,7 @@ isOpen = $bindable(false), requestType = null, portalSlug = '', + draftsEnabled = true, isDarkMode = false, // Field values to seed on open, keyed by field_identifier (e.g. the // clicked asset id for an asset field). Applied after any draft resume so @@ -145,7 +146,7 @@ // Auto-resume any saved draft for this request type. Only the portal // path has drafts — internal usage of this modal opens fresh. - if (portalSlug) { + if (portalSlug && draftsEnabled) { await applyDraftIfPresent(); } @@ -234,7 +235,7 @@ // not block on it. Returns a promise so callers may await if they want to // (e.g. before navigating away). async function saveDraft() { - if (!portalSlug || !requestType) return; + if (!portalSlug || !requestType || !draftsEnabled) return; savingDraft = true; draftJustSaved = false; try { @@ -365,7 +366,7 @@ // call delete here too so callers polling drafts.list right after // submission see a consistent view without depending on backend // ordering. Best-effort. - if (portalSlug) { + if (portalSlug && draftsEnabled) { portal.drafts.delete(portalSlug, requestType.id).catch((err) => { if (err?.status !== 404) { surfaceError(err, { silent: true, context: 'deleteDraftAfterSubmit' }); diff --git a/frontend/src/lib/features/channels/ChannelPortalConfig.svelte b/frontend/src/lib/features/channels/ChannelPortalConfig.svelte index ed454b4b7..fa03ba281 100644 --- a/frontend/src/lib/features/channels/ChannelPortalConfig.svelte +++ b/frontend/src/lib/features/channels/ChannelPortalConfig.svelte @@ -7,6 +7,9 @@ import WorkspacePicker from '../../pickers/WorkspacePicker.svelte'; import DescriptionText from '../../components/DescriptionText.svelte'; import Toggle from '../../components/Toggle.svelte'; + import Checkbox from '../../components/Checkbox.svelte'; + import SelectField from '../../components/SelectField.svelte'; + import PortalBoardPlacements from './PortalBoardPlacements.svelte'; import Lozenge from '../../components/Lozenge.svelte'; import TextField from '../../components/TextField.svelte'; @@ -20,7 +23,8 @@ registration_mode: 'open', allowed_domains: '' }), - connectedMailboxes = [] + connectedMailboxes = [], + channelId = null, } = $props(); const SLUG_PATTERN = /^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$/; @@ -41,7 +45,7 @@ if (!SLUG_PATTERN.test(formData.slug.trim())) { return { valid: false, message: t('channel.portalSlugInvalid') }; } - if (!formData.workspace_ids?.length) { + if (!formData.workspace_ids?.length && (formData.modules == null || formData.modules.includes('forms'))) { return { valid: false, message: t('channel.selectAtLeastOneWorkspace') }; } const domains = parseDomains(formData.allowed_domains); @@ -58,7 +62,11 @@ portal_title: formData.title || formData.slug, portal_description: formData.description || '', portal_registration_mode: formData.registration_mode === 'manual' ? 'manual' : 'open', - portal_allowed_domains: parseDomains(formData.allowed_domains) + portal_allowed_domains: parseDomains(formData.allowed_domains), + portal_presentation: formData.presentation || 'classic', + portal_modules: formData.modules ?? null, + portal_navigation: formData.navigation || [], + portal_default_module: formData.default_module || '', }; } @@ -67,6 +75,20 @@

{t('channel.portalConfiguration')}

+ formData.presentation = value} /> + Compact omits the hero, background artwork, and footer columns. Branding, features, access rules, URLs, and existing layout settings are retained when switching back. +
+
Enabled capabilities
+ {#each [{ id: 'boards', label: 'Boards' }, { id: 'requests', label: 'My requests' }, { id: 'forms', label: 'Request forms' }, { id: 'knowledge-base', label: 'Knowledge base' }, { id: 'drafts', label: 'Drafts' }, { id: 'approvals', label: 'Approvals' }, { id: 'profile', label: 'Profile and security' }, { id: 'asset-reports', label: 'Asset reports' }] as capability} + { + const modules = formData.modules ?? ['boards', 'requests', 'forms', 'knowledge-base', 'drafts', 'approvals', 'profile', 'asset-reports']; + formData.modules = enabled ? [...new Set([...modules, capability.id])] : modules.filter(id => id !== capability.id); + }} /> + {/each} +
+ formData.navigation = event.currentTarget.value.split(',').map(value => value.trim()).filter(Boolean)} helper="Comma-separated module keys or board:. Unlisted modules follow in their existing order." /> + formData.default_module = event.currentTarget.value.trim()} helper="Use requests, forms, knowledge-base, board:, form:, or article:. Leave empty for the first accessible module." /> + {#if channelId}{/if}
{#snippet portalSlugLabel()} {t('channel.portalSlug')} ({t('channel.portalSlugHelp')}) diff --git a/frontend/src/lib/features/channels/Channels.svelte b/frontend/src/lib/features/channels/Channels.svelte index 95f2fc4ca..ed7839b84 100644 --- a/frontend/src/lib/features/channels/Channels.svelte +++ b/frontend/src/lib/features/channels/Channels.svelte @@ -2,6 +2,8 @@ let tabPanelElement = $state(null); import { onMount } from 'svelte'; import StateDisplay from '../../components/StateDisplay.svelte'; + import LazyRootView from '../../components/LazyRootView.svelte'; + const loadPublicBoards = () => import('../../settings/PublicBoards.svelte'); import { useEventListener } from 'runed'; import { t } from '../../stores/i18n.svelte.js'; import IconLifebuoy from '@tabler/icons-svelte-runes/icons/lifebuoy'; @@ -47,7 +49,8 @@ // Channel type definitions for embedded tab navigation. let channelTabs = $derived([ { id: 'all', label: t('channels.allTypes', 'All'), icon: allTypesEntry.icon }, - ...channelTypeDefs.map(ct => ({ id: ct.id, label: t(`channels.${ct.id}`, ct.id), icon: ct.icon })) + ...channelTypeDefs.map(ct => ({ id: ct.id, label: t(`channels.${ct.id}`, ct.id), icon: ct.icon })), + { id: 'public-boards', label: 'Public boards', icon: allTypesEntry.icon }, ]); let channels = $state([]); @@ -508,6 +511,9 @@
+ {#if activeTypeFilter === 'public-boards'} + + {:else}
{#if !embedded} @@ -624,6 +630,7 @@ {/snippet} {/if} + {/if}
diff --git a/frontend/src/lib/features/channels/ManagerChannels.svelte b/frontend/src/lib/features/channels/ManagerChannels.svelte index 27e165bc5..89d8dcf3b 100644 --- a/frontend/src/lib/features/channels/ManagerChannels.svelte +++ b/frontend/src/lib/features/channels/ManagerChannels.svelte @@ -1,6 +1,17 @@ + +
+

Content / Navigation — boards

+ Link an existing publication without cloning its collection. Portal admission, the board audience, and this placement audience must all allow the visitor. Linking never changes standalone availability. + {#if error}{/if} + {#each placements as placement (placement.id)} +
+
+

{placement.label}

+ {placement.source_name || `Board ${placement.collection_id}`} settings + {placement.enabled ? 'Enabled' : 'Disabled'} · placement audience: {placement.policy.mode} · landing key board:{placement.id} + {#if placement.effective_policy}Effective audience: {placement.effective_policy.mode === 'public' ? 'Anyone admitted by this portal' : placement.effective_policy.organisation_ids.length ? `Organisations ${placement.effective_policy.organisation_ids.join(', ')}` : 'Nobody (empty audience intersection)'}{/if} + {#if placement.standalone_enabled && placement.baseline_policy?.mode === 'public'}The standalone location has an independently unrestricted audience when publication is enabled.{/if} +
+
+
+ {/each} + {#if !draft} + + + {:else} +
+ {#if !draft.id} + + ({ value: String(board.collection_id), label: board.name }))]} /> + {/if} + + + draft.enabled = enabled} /> + +
+
+ {/if} +
diff --git a/frontend/src/lib/features/channels/PortalChannelPage.svelte b/frontend/src/lib/features/channels/PortalChannelPage.svelte index a11d9666d..458cf0dc2 100644 --- a/frontend/src/lib/features/channels/PortalChannelPage.svelte +++ b/frontend/src/lib/features/channels/PortalChannelPage.svelte @@ -42,6 +42,10 @@ description: '', registration_mode: 'open', allowed_domains: '', + presentation: 'classic', + modules: null, + navigation: [], + default_module: '', }); // Email channels with an intake linked to this portal. @@ -78,6 +82,10 @@ title: config.portal_title || '', description: config.portal_description || '', registration_mode: config.portal_registration_mode === 'manual' ? 'manual' : 'open', + presentation: config.portal_presentation || 'classic', + modules: config.portal_modules ?? null, + navigation: config.portal_navigation || [], + default_module: config.portal_default_module || '', allowed_domains: Array.isArray(config.portal_allowed_domains) ? config.portal_allowed_domains.join(', ') : '', @@ -158,6 +166,7 @@ {#if tabId === 'settings'} + import Link from '../../components/Link.svelte'; + import DescriptionText from '../../components/DescriptionText.svelte'; + let { publication } = $props(); + function audience(policy) { + if (policy.mode === 'public') return 'Anyone with the link'; + if (!policy.organisation_ids.length) return 'Nobody (empty audience intersection)'; + return policy.organisation_ids.map(id => publication.organisations?.find(org => org.id === id)?.name || `Organisation ${id}`).join(', '); + } + +
+ {#each publication.locations || [] as location (location.url)} +
+ {location.label} + {location.enabled ? 'Active' : 'Unavailable'} · {audience(location.effective_policy)}{location.kind === 'portal' ? ' · Portal registration and domain rules also apply' : ''} + {#if location.channel_id && publication.can_administer}Configure portal{/if} +
+ {:else}No active publication locations configured.{/each} +
diff --git a/frontend/src/lib/features/collections/BoardSharingEditor.svelte b/frontend/src/lib/features/collections/BoardSharingEditor.svelte new file mode 100644 index 000000000..6b9c0461c --- /dev/null +++ b/frontend/src/lib/features/collections/BoardSharingEditor.svelte @@ -0,0 +1,132 @@ + + +
+ {#if error}{/if} + {#if loading}{:else if draft} +
+

{original.name}

+ Owner: {original.owner_name || 'Missing owner'}. Source scope: {original.scope || 'Unscoped collection'}. +
+ {#if !original.instance_enabled}{/if} + {#if locked}{/if} + draft.enabled = value} /> + draft.standalone_enabled = value} /> + draft.slug = event.currentTarget.value.trim()} helper="3–64 lowercase letters, numbers, and hyphens. Existing URLs remain valid until you change the slug." /> + {#if original.enabled && original.standalone_enabled && original.slug} +
+ `${publicBaseURL()}/board/${original.slug}`} label="Copy link" /> + +
+ {/if} + +

Used by / current effective access

+ {draft.policy.mode === 'public' && draft.standalone_enabled ? 'Anyone with the standalone link can view this board when publication is enabled.' : 'Every placement must also satisfy this board audience. An empty restricted allowlist admits nobody.'} + draft.milestone_swimlanes = value} /> +
+ + +
+ {#if original.can_administer} +
+ {#if locked} + + Clearing the lock does not enable publication. + {:else} + + + {/if} +
+ {/if} + + {#if history} +
+ {#each history as event (event.id)} +
+

{event.actor_name || 'Deleted actor'} · {event.created_at} · {event.action}

+ {#if event.reason}

{event.reason}

{/if} +
Before / after
{JSON.stringify({ before: event.before, after: event.after }, null, 2)}
+
+ {:else}No recorded sharing history is available.{/each} +
+ {/if} + {/if} +
diff --git a/frontend/src/lib/features/collections/CollectionViewSwitcher.svelte b/frontend/src/lib/features/collections/CollectionViewSwitcher.svelte index 590988435..ac087e965 100644 --- a/frontend/src/lib/features/collections/CollectionViewSwitcher.svelte +++ b/frontend/src/lib/features/collections/CollectionViewSwitcher.svelte @@ -10,6 +10,12 @@ import Globe from '@lucide/svelte/icons/globe'; import ButtonGroup from '../../components/ButtonGroup.svelte'; import { workspacePermissions } from '../../stores/workspacePermissions.svelte.js'; + import { isSystemAdmin } from '../../stores/permissions.svelte.js'; + import Modal from '../../dialogs/Modal.svelte'; + import ModalHeader from '../../dialogs/ModalHeader.svelte'; + import BoardSharingEditor from './BoardSharingEditor.svelte'; + let showSharing = $state(false); + let savedSlug = $state(undefined); // Props let { @@ -19,6 +25,9 @@ publicSlug = null, } = $props(); + $effect(() => { collectionId; savedSlug = undefined; showSharing = false; }); + const visibleSlug = $derived(savedSlug === undefined ? publicSlug : savedSlug); + // Keep the enabled-views lookup warm; board/backlog hide when disabled. $effect(() => { if (workspaceId || collectionId) { @@ -107,19 +116,27 @@ {/if} - {#if publicSlug} + {#if collectionId && (isCollectionCreator || $isSystemAdmin)} + + {/if} + {#if visibleSlug} { e.stopPropagation(); window.open(`/board/${publicSlug}`, '_blank'); e.preventDefault(); }} + title="Open shared board" > - {t('collections.publicBoard')} + Open shared board {/if} {/snippet} +{#if showSharing} + showSharing = false} maxWidth="max-w-xl" closeOnBackdropClick={false}> + showSharing = false} /> +
showSharing = false} onsaved={(value, close) => { savedSlug = value.enabled && value.standalone_enabled && !value.revoked_at ? value.slug : null; if (close) showSharing = false; }} />
+
+{/if} diff --git a/frontend/src/lib/features/collections/Collections.svelte b/frontend/src/lib/features/collections/Collections.svelte index 7f6d691be..46c0c7eab 100644 --- a/frontend/src/lib/features/collections/Collections.svelte +++ b/frontend/src/lib/features/collections/Collections.svelte @@ -318,8 +318,19 @@ } } - async function handlePublicSharingSave({ isPublic, publicSlug, publicMilestoneSwimlanes }) { + async function handlePublicSharingSave({ isPublic, publicSlug, publicMilestoneSwimlanes, savedSharing = null }) { if (!currentCollection) return { ok: false, error: 'Collection not found.' }; + if (savedSharing) { + currentCollection = { ...currentCollection, + is_public: savedSharing.enabled && savedSharing.standalone_enabled, + board_enabled: savedSharing.enabled, + public_slug: savedSharing.slug, + public_milestone_swimlanes: savedSharing.milestone_swimlanes, + sharing_revision: savedSharing.revision, + }; + slugSaved = Boolean(currentCollection.is_public && currentCollection.public_slug); + return { ok: true }; + } savingPublicSharing = true; try { const update = buildCollectionUpdate({ diff --git a/frontend/src/lib/features/collections/CollectionsBreadcrumbs.svelte b/frontend/src/lib/features/collections/CollectionsBreadcrumbs.svelte index dc88d7365..c09eb275a 100644 --- a/frontend/src/lib/features/collections/CollectionsBreadcrumbs.svelte +++ b/frontend/src/lib/features/collections/CollectionsBreadcrumbs.svelte @@ -163,7 +163,7 @@ size="sm" icon={IconWorld} > - {isPublic ? t('collections.public') : t('collections.publish')} + Share board {/if} diff --git a/frontend/src/lib/features/collections/PublicBoardSharingDialog.svelte b/frontend/src/lib/features/collections/PublicBoardSharingDialog.svelte index 8aaaffd07..9795252cc 100644 --- a/frontend/src/lib/features/collections/PublicBoardSharingDialog.svelte +++ b/frontend/src/lib/features/collections/PublicBoardSharingDialog.svelte @@ -9,7 +9,7 @@ import DialogFooter from '../../dialogs/DialogFooter.svelte'; import Modal from '../../dialogs/Modal.svelte'; import ModalHeader from '../../dialogs/ModalHeader.svelte'; - import CustomerPolicyEditor from '../../customer/CustomerPolicyEditor.svelte'; + import BoardSharingEditor from './BoardSharingEditor.svelte'; import { publicBaseURL } from '../../runtime/contextPath.js'; import { t } from '../../stores/i18n.svelte.js'; @@ -92,6 +92,14 @@ onclose={close} /> + {#if collectionId} +
+ { + onsave?.({ savedSharing }); + if (shouldClose) close(); + }} /> +
+ {:else}
- {#if collectionId}{/if} {#if saveError}
+ {/if} diff --git a/frontend/src/lib/layout/Portal.svelte b/frontend/src/lib/layout/Portal.svelte index 04904621d..31953b142 100644 --- a/frontend/src/lib/layout/Portal.svelte +++ b/frontend/src/lib/layout/Portal.svelte @@ -10,6 +10,13 @@ import ModalBackdrop from '../components/ModalBackdrop.svelte'; import Spinner from '../components/Spinner.svelte'; import EmptyState from '../components/EmptyState.svelte'; + import LazyRootView from '../components/LazyRootView.svelte'; + import Link from '../components/Link.svelte'; + import { portalBoards } from '../api/portalBoards.js'; + let { experience = null } = $props(); + const loadLinkedBoard = () => import('../pages/PublicBoard.svelte'); + const linkedPlacementId = $derived($currentRoute.params?.placementId || null); + const linkedBoardClient = $derived(linkedPlacementId ? portalBoards.client($currentRoute.params.slug, linkedPlacementId) : null); import Button from '../components/Button.svelte'; import PortalHeader from '../portal/PortalHeader.svelte'; import PortalHero from '../portal/PortalHero.svelte'; @@ -506,7 +513,7 @@

{t('portal.checkingAuth')}

- {:else if isUserAuthenticated} + {:else if isUserAuthenticated || linkedPlacementId}
@@ -527,17 +534,27 @@ + {#if experience?.boards?.length} + + {/if} - {#if !portalRequestsStore.visible && !portalApprovalsStore.visible && !portalDraftsStore.visible && !isProfileRoute && !isKBBrowseRoute && !isKBArticleRoute} + {#if !linkedPlacementId && !portalRequestsStore.visible && !portalApprovalsStore.visible && !portalDraftsStore.visible && !isProfileRoute && !isKBBrowseRoute && !isKBArticleRoute} {/if}
- {#if isProfileRoute} + {#if linkedPlacementId} + {#key linkedPlacementId} navigate(`/portal/${experience.slug}/boards/${linkedPlacementId}${key ? `/items/${encodeURIComponent(key)}` : ''}`), + onaccessdenied: status => { if (status === 401) portalStore.showLoginDialog = true; }, + }} />{/key} + {:else if isProfileRoute} {:else if isKBArticleRoute} diff --git a/frontend/src/lib/pages/PublicBoard.svelte b/frontend/src/lib/pages/PublicBoard.svelte index 59982dcdc..223e3aa18 100644 --- a/frontend/src/lib/pages/PublicBoard.svelte +++ b/frontend/src/lib/pages/PublicBoard.svelte @@ -1,9 +1,8 @@
-
-
- Windshift - {#if board} -
-

{board.collection.name}

- {#if board.collection.description} -

{board.collection.description}

- {/if} -
- {/if} -
- -
+ {#if !embedded} + + {/if}
@@ -233,8 +209,8 @@ {#snippet publicCard(card)}
selectedItemKey = card.key} - onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); selectedItemKey = card.key; } }} + onclick={() => selectItem(card.key)} + onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); selectItem(card.key); } }} role="button" tabindex="0" data-testid="public-board-card" @@ -379,15 +355,17 @@
+ {#if !embedded}
Windshift Powered by Windshift
+ {/if} {#if selectedItemKey} - selectedItemKey = null} /> + {#key selectedItemKey} selectItem(null)} />{/key} {/if}
diff --git a/frontend/src/lib/pages/PublicBoardItemDetail.svelte b/frontend/src/lib/pages/PublicBoardItemDetail.svelte index 081d36090..86e3513c0 100644 --- a/frontend/src/lib/pages/PublicBoardItemDetail.svelte +++ b/frontend/src/lib/pages/PublicBoardItemDetail.svelte @@ -9,7 +9,7 @@ import Text from '../components/Text.svelte'; import LazyMilkdownEditor from '../editors/LazyMilkdownEditor.svelte'; - let { slug, itemKey, onclose } = $props(); + let { slug, itemKey, onclose, client = publicBoard } = $props(); let item = $state(null); let loading = $state(true); @@ -17,7 +17,7 @@ onMount(async () => { try { - item = await publicBoard.getItem(slug, itemKey); + item = await client.getItem(slug, itemKey); } catch (err) { error = err.status === 404 ? 'not_found' : 'error'; } finally { diff --git a/frontend/src/lib/portal/PortalKBArticle.svelte b/frontend/src/lib/portal/PortalKBArticle.svelte index 380d8ede8..8987b3945 100644 --- a/frontend/src/lib/portal/PortalKBArticle.svelte +++ b/frontend/src/lib/portal/PortalKBArticle.svelte @@ -15,7 +15,7 @@ * wiring does not publish. */ - let { pageId } = $props(); + let { pageId, onunavailable = null } = $props(); let page = $state(null); let loading = $state(true); @@ -40,6 +40,7 @@ if (seq !== requestSeq) return; page = null; error = err?.message || 'Failed to load this article.'; + if (err?.status === 403 || err?.status === 404) onunavailable?.(); } finally { if (seq === requestSeq) loading = false; } diff --git a/frontend/src/lib/router.js b/frontend/src/lib/router.js index 6ec4bee70..7313296c9 100644 --- a/frontend/src/lib/router.js +++ b/frontend/src/lib/router.js @@ -161,6 +161,8 @@ const routes = { '/portal/:slug/kb': 'portal', '/portal/:slug/kb/:pageId': 'portal', '/portal/:slug/request/:requestTypeId': 'portal', + '/portal/:slug/boards/:placementId': 'portal', + '/portal/:slug/boards/:placementId/items/:itemKey': 'portal', '/forms/:slug/:formId': 'public-form', '/forms/:slug': 'public-form', '/set-password/:token': 'set-password', diff --git a/frontend/src/lib/services/authenticatedShellUI.js b/frontend/src/lib/services/authenticatedShellUI.js index 384c9076e..a82f892aa 100644 --- a/frontend/src/lib/services/authenticatedShellUI.js +++ b/frontend/src/lib/services/authenticatedShellUI.js @@ -35,6 +35,7 @@ export function hydrateAuthenticatedShellUI(bootstrap) { permissionStore.setHasPortals(bootstrap.has_portals === true); permissionStore.setHasActivePortals(bootstrap.has_active_portals === true); permissionStore.setManagesChannels(bootstrap.manages_channels === true); + permissionStore.setOwnsBoards(bootstrap.owns_boards === true); permissionStore.setManagesAssetSets(bootstrap.manages_asset_sets === true); return true; } diff --git a/frontend/src/lib/settings/PublicBoards.svelte b/frontend/src/lib/settings/PublicBoards.svelte new file mode 100644 index 000000000..33f58a421 --- /dev/null +++ b/frontend/src/lib/settings/PublicBoards.svelte @@ -0,0 +1,89 @@ + + +
+ +
+ { query = event.currentTarget.value; page = 1; }} /> + { publicationState = value; page = 1; }} options={[{ value: 'all', label: 'All' }, { value: 'enabled', label: 'Enabled' }, { value: 'disabled', label: 'Disabled' }, { value: 'revoked', label: 'Revoked' }]} /> + { accessMode = value; page = 1; }} options={[{ value: '', label: 'All audiences' }, { value: 'public', label: 'Unrestricted' }, { value: 'organisations', label: 'Windshift organisations' }]} /> + { workspace = event.currentTarget.value; page = 1; }} /> + { owner = event.currentTarget.value; page = 1; }} /> + { organisation = event.currentTarget.value; page = 1; }} /> +
+ {#if error}{/if} + ({ 'data-testid': `public-board-row-${item.collection_id}` })}> + {#snippet locations(item)}{/snippet} + {#snippet actions(item)} +
+ + {#if item.enabled && item.standalone_enabled && item.slug && !item.revoked_at && item.instance_enabled} + + `${publicBaseURL()}/board/${item.slug}`} label="Copy link" /> + {/if} +
+ {/snippet} +
+
+ + selected = null} maxWidth="max-w-xl" closeOnBackdropClick={false} dataTestid="public-board-management-dialog"> + selected = null} /> + {#if selected !== null} +
selected = null} onsaved={(_, close) => { refresh++; if (close) selected = null; }} />
+ {/if} +
diff --git a/frontend/src/lib/settings/SecuritySettings.svelte b/frontend/src/lib/settings/SecuritySettings.svelte index 956f6f8e8..dbe1d13b5 100644 --- a/frontend/src/lib/settings/SecuritySettings.svelte +++ b/frontend/src/lib/settings/SecuritySettings.svelte @@ -32,6 +32,7 @@ let calendarFeedEnabled = $state(true); let pluginCliExecEnabled = $state(false); let allowExternalImages = $state(false); + let publicBoardsEnabled = $state(true); let allowUserManagedAgents = $state(false); let maxAgentsPerUser = $state(5); let workspaceManagedAgents = $state(true); @@ -126,6 +127,7 @@ calendarFeedEnabled = settings.calendar_feed_enabled ?? true; pluginCliExecEnabled = settings.plugin_cli_exec_enabled ?? false; allowExternalImages = settings.allow_external_images ?? false; + publicBoardsEnabled = settings.public_boards_enabled ?? true; allowUserManagedAgents = settings.allow_user_managed_agents ?? false; maxAgentsPerUser = settings.max_agents_per_user ?? 5; workspaceManagedAgents = settings.workspace_managed_agents ?? true; @@ -170,6 +172,7 @@ calendar_feed_enabled: calendarFeedEnabled, plugin_cli_exec_enabled: pluginCliExecEnabled, allow_external_images: allowExternalImages, + public_boards_enabled: publicBoardsEnabled, allow_user_managed_agents: allowUserManagedAgents, max_agents_per_user: maxAgentsPerUser, workspace_managed_agents: workspaceManagedAgents, @@ -220,6 +223,11 @@ } } + async function handlePublicBoardsToggle(newValue) { + publicBoardsEnabled = newValue; + if (!(await saveSettings())) publicBoardsEnabled = !newValue; + } + async function handleUserManagedAgentsToggle(newValue) { allowUserManagedAgents = newValue; await saveSettings(); @@ -287,6 +295,12 @@ {:else} + +

Public boards

+ + Pausing retains publication settings and URLs. Re-enabling resumes boards that have not been disabled or revoked. + {#if !publicBoardsEnabled}{/if} +
diff --git a/frontend/src/lib/stores/permissions.svelte.js b/frontend/src/lib/stores/permissions.svelte.js index 9af836b40..30a0ea607 100644 --- a/frontend/src/lib/stores/permissions.svelte.js +++ b/frontend/src/lib/stores/permissions.svelte.js @@ -22,6 +22,7 @@ function createPermissionStore() { const hasPortals = writable(false); const managesChannels = writable(false); const managesAssetSets = writable(false); + const ownsBoards = writable(false); let allPermissionsLoaded = false; let allPermissionsLoadPromise = null; let allPermissionsLoadGeneration = 0; @@ -73,10 +74,10 @@ function createPermissionStore() { ); const canManageChannels = derived( - [authStore, managesChannels], - ([$authStore, $managesChannels]) => { + [authStore, managesChannels, ownsBoards, userPermissionKeys], + ([$authStore, $managesChannels, $ownsBoards, $keys]) => { if (!$authStore.currentUser) return false; - return $managesChannels; + return $managesChannels || $ownsBoards || $keys.has('public_board.manage'); } ); @@ -96,6 +97,7 @@ function createPermissionStore() { canManageAssets, canManageChannels, managesAssetSets, + managesChannels, ], ([ $permissions, @@ -111,6 +113,7 @@ function createPermissionStore() { $canManageAssets, $canManageChannels, $managesAssetSets, + $managesChannels, ]) => ({ permissions: $permissions, userPermissions: $userPermissions, @@ -125,6 +128,7 @@ function createPermissionStore() { canManageAssets: $canManageAssets, canManageChannels: $canManageChannels, managesAssetSets: $managesAssetSets, + managesChannels: $managesChannels, }) ); @@ -200,6 +204,9 @@ function createPermissionStore() { setManagesChannels(value) { managesChannels.set(value); }, + setOwnsBoards(value) { + ownsBoards.set(value); + }, // Set whether the current user administers at least one asset set setManagesAssetSets(value) { @@ -294,6 +301,7 @@ function createPermissionStore() { userPermissions.set(new Set()); userPermissionKeys.set(new Set()); managesChannels.set(false); + ownsBoards.set(false); managesAssetSets.set(false); loading.set(false); error.set(null); diff --git a/frontend/src/lib/stores/portal.svelte.js b/frontend/src/lib/stores/portal.svelte.js index 1915efa9b..be8cb57fe 100644 --- a/frontend/src/lib/stores/portal.svelte.js +++ b/frontend/src/lib/stores/portal.svelte.js @@ -126,7 +126,9 @@ configurePortalActivityStore({ /** * Load portal data by slug */ +let portalLoadId = 0; async function loadPortal(slug) { + const loadId = ++portalLoadId; try { loading = true; error = null; @@ -144,6 +146,7 @@ async function loadPortal(slug) { } const bootstrap = await portal.getBootstrap(slug); + if (loadId !== portalLoadId) return; portalData = bootstrap.portal; // Initialize editable state with portal data @@ -183,13 +186,14 @@ async function loadPortal(slug) { // Allow saves from user changes after initial load setTimeout(() => { - isInitialLoad = false; + if (loadId === portalLoadId) isInitialLoad = false; }, 100); } catch (err) { + if (loadId !== portalLoadId) return; error = err.message || 'Failed to load portal'; surfaceError(err, { context: 'loadPortal' }); } finally { - loading = false; + if (loadId === portalLoadId) loading = false; } } @@ -615,6 +619,7 @@ function closeAllMenus() { // Reset store (for cleanup) function reset() { + portalLoadId++; // Cancel a pending debounced customization save so it cannot fire after // navigation and write stale state to a newly loaded portal. if (saveTimeout) { diff --git a/frontend/src/lib/stores/portalAuth.svelte.js b/frontend/src/lib/stores/portalAuth.svelte.js index 76993c98d..18ddbc259 100644 --- a/frontend/src/lib/stores/portalAuth.svelte.js +++ b/frontend/src/lib/stores/portalAuth.svelte.js @@ -22,6 +22,7 @@ function createPortalAuthStore() { const userBootstrap = writable(null); const customer = writable(null); const user = writable(null); // internal user + let authCheckId = 0; const isAuthenticated = writable(false); const isInternal = writable(false); // true if authenticated via internal session const loading = writable(false); @@ -122,11 +123,13 @@ function createPortalAuthStore() { * @param {string} slug - Portal slug */ async checkAuth(slug) { + const checkId = ++authCheckId; loading.set(true); error.set(null); try { const response = await portal.getUserBootstrap(slug); + if (checkId !== authCheckId) return null; userBootstrap.set(response); if (response.authenticated) { if (response.is_internal) { @@ -152,6 +155,7 @@ function createPortalAuthStore() { } return response; } catch (_err) { + if (checkId !== authCheckId) return null; // Not authenticated is not an error customer.set(null); user.set(null); @@ -161,7 +165,7 @@ function createPortalAuthStore() { userBootstrap.set({ authenticated: false, my_requests: [], my_approvals: [] }); return getStoreValue(userBootstrap); } finally { - loading.set(false); + if (checkId === authCheckId) loading.set(false); } }, @@ -355,6 +359,7 @@ function createPortalAuthStore() { * Clear all state (used when navigating away from portal) */ reset() { + authCheckId++; clearStores(customer, user, error); isAuthenticated.set(false); isInternal.set(false); diff --git a/internal/database/board_publication_migration.go b/internal/database/board_publication_migration.go new file mode 100644 index 000000000..75ccb04b8 --- /dev/null +++ b/internal/database/board_publication_migration.go @@ -0,0 +1,33 @@ +package database + +const boardPublicationMigration = ` +ALTER TABLE collections ADD COLUMN board_enabled BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE collections ADD COLUMN board_standalone_enabled BOOLEAN NOT NULL DEFAULT true; +ALTER TABLE collections ADD COLUMN board_ever_published BOOLEAN NOT NULL DEFAULT false; +ALTER TABLE collections ADD COLUMN sharing_revision INTEGER NOT NULL DEFAULT 1; +ALTER TABLE collections ADD COLUMN public_revoked_at TEXT; +ALTER TABLE collections ADD COLUMN public_revoked_by INTEGER REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE collections ADD COLUMN public_revoke_reason TEXT NOT NULL DEFAULT ''; +ALTER TABLE collections ADD COLUMN sharing_changed_at TEXT; +ALTER TABLE collections ADD COLUMN sharing_changed_by INTEGER REFERENCES users(id) ON DELETE SET NULL; +UPDATE collections SET board_enabled = is_public, board_ever_published = is_public; +INSERT INTO system_settings (key, value, value_type, description, category) +VALUES ('public_boards_enabled', 'true', 'boolean', 'Allow external board publications', 'security') +ON CONFLICT(key) DO NOTHING; +` + +const boardPlacementSchema = ` +CREATE TABLE IF NOT EXISTS board_placements ( + id TEXT PRIMARY KEY, + collection_id INTEGER NOT NULL REFERENCES collections(id) ON DELETE CASCADE, + channel_id INTEGER NOT NULL REFERENCES channels(id) ON DELETE CASCADE, + label TEXT NOT NULL, + display_order INTEGER NOT NULL DEFAULT 0, + enabled BOOLEAN NOT NULL DEFAULT true, + access_mode TEXT NOT NULL DEFAULT 'public' CHECK(access_mode IN ('public', 'organisations')), + organisation_ids TEXT NOT NULL DEFAULT '[]', + revision INTEGER NOT NULL DEFAULT 1, + UNIQUE(collection_id, channel_id) +); +CREATE INDEX IF NOT EXISTS idx_board_placements_channel ON board_placements(channel_id, display_order); +` diff --git a/internal/database/migrations.go b/internal/database/migrations.go index 871a33177..1731744e9 100644 --- a/internal/database/migrations.go +++ b/internal/database/migrations.go @@ -3426,6 +3426,22 @@ CREATE INDEX IF NOT EXISTS idx_plane_import_mappings_windshift ON plane_import_m SQLite: "ALTER TABLE user_sessions ADD COLUMN remember_me BOOLEAN NOT NULL DEFAULT false", Postgres: "ALTER TABLE user_sessions ADD COLUMN IF NOT EXISTS remember_me BOOLEAN NOT NULL DEFAULT false", }, + { + Version: "20261126_board_publication_governance", + Name: "Separate external board publication and standalone availability with durable governance", + CheckSQLite: sqliteColumnCheck("collections", "sharing_revision"), + CheckPostgres: pgColumnCheck("collections", "sharing_revision"), + SQLite: boardPublicationMigration, + Postgres: boardPublicationMigration, + }, + { + Version: "20261126_board_portal_placements", + Name: "Add native portal board placements with independently narrower audiences", + CheckSQLite: `SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name = 'board_placements'`, + CheckPostgres: `SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = current_schema() AND table_name = 'board_placements'`, + SQLite: boardPlacementSchema, + Postgres: boardPlacementSchema, + }, } const timeWorklogDraftsMigrationSQLite = ` diff --git a/internal/database/schema/system.sql b/internal/database/schema/system.sql index 7955cdc15..88f41058e 100644 --- a/internal/database/schema/system.sql +++ b/internal/database/schema/system.sql @@ -181,6 +181,15 @@ CREATE TABLE IF NOT EXISTS collections ( category_id INTEGER, created_by INTEGER, public_slug TEXT UNIQUE, + board_enabled BOOLEAN NOT NULL DEFAULT false, + board_standalone_enabled BOOLEAN NOT NULL DEFAULT true, + board_ever_published BOOLEAN NOT NULL DEFAULT false, + sharing_revision INTEGER NOT NULL DEFAULT 1, + public_revoked_at TEXT, + public_revoked_by INTEGER REFERENCES users(id) ON DELETE SET NULL, + public_revoke_reason TEXT NOT NULL DEFAULT '', + sharing_changed_at TEXT, + sharing_changed_by INTEGER REFERENCES users(id) ON DELETE SET NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE, @@ -195,6 +204,7 @@ CREATE INDEX IF NOT EXISTS idx_collections_is_public ON collections(is_public); CREATE INDEX IF NOT EXISTS idx_collections_category_id ON collections(category_id); CREATE UNIQUE INDEX IF NOT EXISTS idx_collections_public_slug ON collections(public_slug); + CREATE TRIGGER IF NOT EXISTS trg_collections_change_update AFTER UPDATE OF ql_query, filter_state, workspace_id ON collections BEGIN INSERT INTO item_change_log(item_id, workspace_id, change_type) VALUES (0, COALESCE(NEW.workspace_id, OLD.workspace_id, 0), 'upsert'); diff --git a/internal/database/schema/system_postgres.sql b/internal/database/schema/system_postgres.sql index ea4a9918c..cc9925f96 100644 --- a/internal/database/schema/system_postgres.sql +++ b/internal/database/schema/system_postgres.sql @@ -195,6 +195,15 @@ CREATE TABLE IF NOT EXISTS collections ( category_id INTEGER, created_by INTEGER, public_slug TEXT UNIQUE, + board_enabled BOOLEAN NOT NULL DEFAULT false, + board_standalone_enabled BOOLEAN NOT NULL DEFAULT true, + board_ever_published BOOLEAN NOT NULL DEFAULT false, + sharing_revision INTEGER NOT NULL DEFAULT 1, + public_revoked_at TEXT, + public_revoked_by INTEGER REFERENCES users(id) ON DELETE SET NULL, + public_revoke_reason TEXT NOT NULL DEFAULT '', + sharing_changed_at TEXT, + sharing_changed_by INTEGER REFERENCES users(id) ON DELETE SET NULL, created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE, @@ -209,6 +218,7 @@ CREATE INDEX IF NOT EXISTS idx_collections_is_public ON collections(is_public); CREATE INDEX IF NOT EXISTS idx_collections_category_id ON collections(category_id); CREATE UNIQUE INDEX IF NOT EXISTS idx_collections_public_slug ON collections(public_slug); + CREATE OR REPLACE FUNCTION log_collection_change() RETURNS trigger AS $$ BEGIN INSERT INTO item_change_log(item_id, workspace_id, change_type) VALUES (0, COALESCE(NEW.workspace_id, OLD.workspace_id, 0), 'upsert'); diff --git a/internal/handlers/customer_access.go b/internal/handlers/customer_access.go index 85518a89a..8845beb97 100644 --- a/internal/handlers/customer_access.go +++ b/internal/handlers/customer_access.go @@ -47,6 +47,9 @@ type CustomerAccessHandler struct { ip *utils.IPExtractor secure bool limiter interface{ AllowRequest(*http.Request) bool } + publicBoards services.PublicBoardAvailability + sharing *services.CollectionApplicationService + boardViewer *PublicBoardHandler } func (h *CustomerAccessHandler) SetLimiter(limiter interface{ AllowRequest(*http.Request) bool }) { @@ -75,10 +78,13 @@ type CustomerAccessDependencies struct { MagicLinks *services.MagicLinkService IP *utils.IPExtractor Secure bool + PublicBoards services.PublicBoardAvailability + Sharing *services.CollectionApplicationService + BoardViewer *PublicBoardHandler } func NewCustomerAccessHandler(deps CustomerAccessDependencies) *CustomerAccessHandler { - return &CustomerAccessHandler{repo: deps.Access, providers: deps.Providers, customers: deps.Customers, channels: deps.Channels, collections: deps.Collections, permissions: deps.Permissions, scope: deps.Scope, portalSessions: deps.PortalSessions, portalAuth: deps.PortalAuth, passkeys: deps.Passkeys, magicLinks: deps.MagicLinks, ip: deps.IP, secure: deps.Secure} + return &CustomerAccessHandler{repo: deps.Access, providers: deps.Providers, customers: deps.Customers, channels: deps.Channels, collections: deps.Collections, permissions: deps.Permissions, scope: deps.Scope, portalSessions: deps.PortalSessions, portalAuth: deps.PortalAuth, passkeys: deps.Passkeys, magicLinks: deps.MagicLinks, ip: deps.IP, secure: deps.Secure, publicBoards: deps.PublicBoards, sharing: deps.Sharing, boardViewer: deps.BoardViewer} } func customerSurfacePath(surface models.CustomerSurface) string { @@ -94,6 +100,10 @@ func customerOpaqueToken() (string, error) { } func (h *CustomerAccessHandler) resolve(w http.ResponseWriter, r *http.Request) (*models.CustomerSurface, bool) { + if r.PathValue("kind") == "board" && h.publicBoards != nil && !h.publicBoards.PublicBoardsEnabled() { + respondNotFound(w, r, "customer resource") + return nil, false + } surface, err := h.repo.Resolve(r.Context(), r.PathValue("kind"), r.PathValue("slug")) if err != nil { respondNotFound(w, r, "customer resource") @@ -195,16 +205,9 @@ func (h *CustomerAccessHandler) managementSurface(w http.ResponseWriter, r *http allowed, err = h.channels.UserCanManage(r.Context(), user.ID, id) } if !allowed && surface.Kind == "board" { - allowed, err = h.permissions.HasGlobalPermission(user.ID, models.PermissionPublicBoardManage) - if err == nil && allowed { - collection, e := h.collections.GetVisibleModel(id, user.ID) - if e != nil { - allowed = false - } else { - _, err = h.scope.AuthorizePublishing(user.ID, collection.QLQuery) - allowed = err == nil - } - } + ownerID, ownerErr := h.collections.GetOwnerID(id) + err = ownerErr + allowed = err == nil && ownerID != nil && *ownerID == user.ID } if err != nil || !allowed { respondForbidden(w, r) @@ -235,6 +238,35 @@ func (h *CustomerAccessHandler) PutPolicy(w http.ResponseWriter, r *http.Request if !ok { return } + if surface.Kind == "board" { + user := utils.GetCurrentUser(r) + service := h.sharing + if service == nil { + respondInternalError(w, r, errors.New("board sharing service is unavailable")) + return + } + current, err := service.GetBoardSharing(user.ID, surface.ID) + if err == nil { + _, err = service.SaveBoardSharing(services.AuditActor{UserID: user.ID, Username: user.Username, IPAddress: utils.GetClientIP(r), UserAgent: r.UserAgent()}, surface.ID, + services.BoardSharingSave{Revision: current.Revision, Enabled: current.Enabled, StandaloneEnabled: current.StandaloneEnabled, Slug: current.Slug, MilestoneSwimlanes: current.MilestoneSwimlanes, Policy: policy}) + } + if err != nil { + var validation *services.CollectionValidationError + switch { + case errors.Is(err, services.ErrCollectionForbidden): + respondForbidden(w, r) + case errors.Is(err, services.ErrCollectionConflict): + respondJSON(w, http.StatusConflict, map[string]any{"error": "Sharing changed; reload before saving", "code": "CONFLICT"}) + case errors.As(err, &validation): + respondValidationError(w, r, validation.Error()) + default: + respondInternalError(w, r, err) + } + return + } + h.GetPolicy(w, r) + return + } if err := h.repo.SavePolicy(r.Context(), *surface, policy); err != nil { if errors.Is(err, repository.ErrCustomerAccessPolicyInvalid) { respondValidationError(w, r, err.Error()) @@ -269,6 +301,10 @@ func (h *CustomerAccessHandler) Guard(next http.Handler) http.Handler { next.ServeHTTP(w, r) return } + if kind == "board" && h.publicBoards != nil && !h.publicBoards.PublicBoardsEnabled() { + respondNotFound(w, r, "customer resource") + return + } w.Header().Set("Cache-Control", "private, no-store") w.Header().Add("Vary", "Cookie") surface, err := h.repo.Resolve(r.Context(), kind, slug) @@ -276,6 +312,45 @@ func (h *CustomerAccessHandler) Guard(next http.Handler) http.Handler { respondNotFound(w, r, "customer resource") return } + if kind == "portal" { + channel, err := h.channels.FindByID(r.Context(), surface.ID) + if err != nil { + respondInternalError(w, r, err) + return + } + var config models.ChannelConfig + if err := json.Unmarshal([]byte(channel.Config), &config); err != nil { + respondInternalError(w, r, err) + return + } + module := "" + if len(parts) > 3 { + switch parts[3] { + case "my-requests", "requests": + module = "requests" + case "request-types", "submit", "custom-fields": + module = "forms" + case "drafts": + module = "drafts" + case "approvals": + module = "approvals" + case "knowledge-base": + module = "knowledge-base" + case "asset-reports", "assets": + module = "asset-reports" + case "credentials", "passkey-prompt": + module = "profile" + case "auth": + if r.Method == http.MethodPut && len(parts) > 4 && parts[4] == "me" { + module = "profile" + } + } + } + if module != "" && !config.PortalModuleEnabled(module) { + respondForbidden(w, r) + return + } + } policy, err := h.repo.Policy(r.Context(), kind, surface.ID) if err != nil { respondInternalError(w, r, err) diff --git a/internal/handlers/portal_boards.go b/internal/handlers/portal_boards.go new file mode 100644 index 000000000..3ccb6dbb6 --- /dev/null +++ b/internal/handlers/portal_boards.go @@ -0,0 +1,249 @@ +package handlers + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "net/http" + "net/url" + "slices" + + "windshift/internal/middleware" + "windshift/internal/models" + "windshift/internal/repository" +) + +func (h *CustomerAccessHandler) portalBoard(w http.ResponseWriter, r *http.Request) (*http.Request, bool) { + w.Header().Set("Cache-Control", "private, no-store") + w.Header().Add("Vary", "Cookie") + if h.boardViewer == nil || h.publicBoards != nil && !h.publicBoards.PublicBoardsEnabled() { + respondNotFound(w, r, "board") + return nil, false + } + portal, err := h.repo.Resolve(r.Context(), "portal", r.PathValue("slug")) + if err != nil { + respondNotFound(w, r, "board") + return nil, false + } + channel, err := h.channels.FindByID(r.Context(), portal.ID) + if err != nil { + respondNotFound(w, r, "board") + return nil, false + } + var config models.ChannelConfig + if err := json.Unmarshal([]byte(channel.Config), &config); err != nil { + respondInternalError(w, r, err) + return nil, false + } + if !config.PortalModuleEnabled("boards") { + respondNotFound(w, r, "board") + return nil, false + } + placement, err := repository.NewBoardPlacementRepository(h.boardViewer.db).Get(r.Context(), portal.ID, r.PathValue("placement_id")) + if err != nil || !placement.Enabled { + respondNotFound(w, r, "board") + return nil, false + } + collection, err := h.collections.GetModel(placement.CollectionID) + if err != nil || !collection.BoardEnabled || collection.IsPrivate || collection.PublicRevokedAt != nil { + respondNotFound(w, r, "board") + return nil, false + } + id := h.customer(r, *portal) + portalPolicy, err := h.repo.Policy(r.Context(), "portal", portal.ID) + if err != nil { + respondInternalError(w, r, err) + return nil, false + } + boardPolicy, err := h.repo.Policy(r.Context(), "board", collection.ID) + if err != nil { + respondInternalError(w, r, err) + return nil, false + } + restricted := portalPolicy.Mode != "public" || boardPolicy.Mode != "public" || placement.Policy.Mode != "public" + if restricted && id == 0 { + respondJSON(w, http.StatusUnauthorized, map[string]any{"error": "Customer sign-in is required", "code": "CUSTOMER_LOGIN_REQUIRED"}) + return nil, false + } + if id > 0 { + _, email, identityErr := h.customers.GetIdentity(r.Context(), id) + if identityErr != nil || h.portalAdmission(r.Context(), *portal, email) != nil { + respondForbidden(w, r) + return nil, false + } + for _, surface := range []models.CustomerSurface{*portal, {Kind: "board", ID: collection.ID}} { + allowed, err := h.repo.Allowed(r.Context(), surface, id) + if err != nil { + respondInternalError(w, r, err) + return nil, false + } + if !allowed { + respondForbidden(w, r) + return nil, false + } + } + if placement.Policy.Mode == "organisations" { + organisationID, err := h.customers.OrganisationID(id) + if err != nil || organisationID == nil || !slices.Contains(placement.Policy.OrganisationIDs, *organisationID) { + respondForbidden(w, r) + return nil, false + } + } + } + prefix := requestContextPrefix(r) + "/api/v2/portal/" + url.PathEscape(portal.Slug) + "/boards/" + url.PathEscape(placement.ID) + "/attachments/" + ctx := context.WithValue(r.Context(), portalBoardContextKey{}, portalBoardContext{CollectionID: collection.ID, AttachmentPrefix: prefix}) + return r.WithContext(ctx), true +} + +func (h *CustomerAccessHandler) GetPortalBoard(w http.ResponseWriter, r *http.Request) { + if request, ok := h.portalBoard(w, r); ok { + h.boardViewer.GetPublicBoard(w, request) + } +} + +func (h *CustomerAccessHandler) GetPortalBoardItem(w http.ResponseWriter, r *http.Request) { + if request, ok := h.portalBoard(w, r); ok { + h.boardViewer.GetPublicBoardItem(w, request) + } +} + +func (h *CustomerAccessHandler) DownloadPortalBoardAttachment(w http.ResponseWriter, r *http.Request) { + if request, ok := h.portalBoard(w, r); ok { + h.boardViewer.DownloadAttachment(w, request) + } +} + +func (h *CustomerAccessHandler) GetPortalExperience(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Cache-Control", "private, no-store") + w.Header().Add("Vary", "Cookie") + surface, err := h.repo.Resolve(r.Context(), "portal", r.PathValue("slug")) + if err != nil { + respondNotFound(w, r, "portal") + return + } + channel, err := h.channels.FindByID(r.Context(), surface.ID) + if err != nil { + respondNotFound(w, r, "portal") + return + } + var config models.ChannelConfig + if err := json.Unmarshal([]byte(channel.Config), &config); err != nil { + respondInternalError(w, r, err) + return + } + id := h.customer(r, *surface) + if id > 0 { + _, email, err := h.customers.GetIdentity(r.Context(), id) + if err != nil || h.portalAdmission(r.Context(), *surface, email) != nil { + respondForbidden(w, r) + return + } + } + policy, err := h.repo.Policy(r.Context(), "portal", surface.ID) + if err != nil { + respondInternalError(w, r, err) + return + } + if policy.Mode != "public" { + if id == 0 { + respondJSON(w, http.StatusUnauthorized, map[string]any{"error": "Customer sign-in is required", "code": "CUSTOMER_LOGIN_REQUIRED"}) + return + } + allowed, err := h.repo.Allowed(r.Context(), *surface, id) + if err != nil { + respondInternalError(w, r, err) + return + } + if !allowed { + respondForbidden(w, r) + return + } + } + result := models.CustomerExperience{Presentation: config.PortalPresentation, Title: config.PortalTitle, LogoURL: config.PortalLogoURL, + Slug: surface.Slug, Modules: config.PortalModules, Navigation: config.PortalNavigation, DefaultModule: config.PortalDefaultModule, + Boards: []models.CustomerExperienceBoard{}, Authenticated: id > 0, IdentityKey: id} + // Internal authentication is useful to existing request modules, never board audience evidence. + if id == 0 && policy.Mode == "public" { + if user, ok := r.Context().Value(middleware.ContextKeyUser).(*models.User); ok && user != nil { + result.Authenticated, result.IsInternal, result.IdentityKey = true, true, -user.ID + } + } + if result.Presentation == "" { + result.Presentation = "classic" + } + if result.Modules == nil { + result.Modules = slices.Clone(models.PortalModuleKinds) + } + if result.Presentation == "compact" { + result.Modules = slices.DeleteFunc(slices.Clone(result.Modules), func(module string) bool { + if module == "knowledge-base" { + return config.KnowledgeBaseShareLink == "" && len(config.KnowledgeBasePageSources) == 0 + } + if module == "forms" { + return len(config.PortalWorkspaceIDs) == 0 + } + if module == "asset-reports" { + return !slices.ContainsFunc(config.PortalSections, func(section models.PortalSection) bool { return len(section.AssetReportIDs) > 0 }) + } + return false + }) + } + if h.boardViewer != nil && config.PortalModuleEnabled("boards") && (h.publicBoards == nil || h.publicBoards.PublicBoardsEnabled()) { + placements, err := repository.NewBoardPlacementRepository(h.boardViewer.db).List(r.Context(), surface.ID) + if err != nil { + respondInternalError(w, r, err) + return + } + for _, placement := range placements { + if !placement.Enabled { + continue + } + collection, err := h.collections.GetModel(placement.CollectionID) + if err != nil || !collection.BoardEnabled || collection.IsPrivate || collection.PublicRevokedAt != nil { + continue + } + baseline, err := h.repo.Policy(r.Context(), "board", collection.ID) + if err != nil { + respondInternalError(w, r, err) + return + } + if id == 0 && (baseline.Mode != "public" || placement.Policy.Mode != "public") { + continue + } + if id > 0 { + allowed, err := h.repo.Allowed(r.Context(), models.CustomerSurface{Kind: "board", ID: collection.ID}, id) + if err != nil { + respondInternalError(w, r, err) + return + } + if !allowed { + continue + } + if placement.Policy.Mode == "organisations" { + organisation, err := h.customers.OrganisationID(id) + if err != nil { + respondInternalError(w, r, err) + return + } + if organisation == nil || !slices.Contains(placement.Policy.OrganisationIDs, *organisation) { + continue + } + } + } + result.Boards = append(result.Boards, models.CustomerExperienceBoard{ID: placement.ID, Label: placement.Label, DisplayOrder: placement.DisplayOrder, PublicationRevision: collection.SharingRevision, PlacementRevision: placement.Revision}) + } + } + revision, err := json.Marshal(struct { + Config string + Policy models.CustomerAccessPolicy + Boards []models.CustomerExperienceBoard + }{channel.Config, policy, result.Boards}) + if err != nil { + respondInternalError(w, r, err) + return + } + digest := sha256.Sum256(revision) + result.Revision = hex.EncodeToString(digest[:]) + respondJSONOK(w, result) +} diff --git a/internal/handlers/portal_bootstrap.go b/internal/handlers/portal_bootstrap.go index 3ee138c18..7f81a8bdd 100644 --- a/internal/handlers/portal_bootstrap.go +++ b/internal/handlers/portal_bootstrap.go @@ -71,11 +71,18 @@ func (h *PortalHandler) GetBootstrap(w http.ResponseWriter, r *http.Request) { } response.Portal = portal + if config.PortalPresentation == "compact" { + respondJSONOK(w, response) + return + } vc := h.getPortalVisibilityContext(ctx, r, channel.ID) var wait sync.WaitGroup wait.Add(2) go func() { defer wait.Done() + if !config.PortalModuleEnabled("forms") { + return + } requestTypes, err := h.loadPortalRequestTypes(ctx, channel.ID, vc) if err != nil { slog.Warn("portal bootstrap: request types unavailable", "channel_id", channel.ID, "error", err) @@ -85,6 +92,9 @@ func (h *PortalHandler) GetBootstrap(w http.ResponseWriter, r *http.Request) { }() go func() { defer wait.Done() + if !config.PortalModuleEnabled("asset-reports") { + return + } assetReports, err := h.loadPortalAssetReports(ctx, channel, config, vc) if err != nil { slog.Warn("portal bootstrap: asset reports unavailable", "channel_id", channel.ID, "error", err) @@ -126,11 +136,18 @@ func (h *PortalHandler) GetUserBootstrap(w http.ResponseWriter, r *http.Request) respondInternalError(w, r, err) return } + if config.PortalPresentation == "compact" { + respondJSONOK(w, response) + return + } var wait sync.WaitGroup wait.Add(2) go func() { defer wait.Done() + if !config.PortalModuleEnabled("requests") { + return + } requests, err := h.loadMyPortalRequests(ctx, r, channel.ID, config) if err != nil { slog.Warn("portal user bootstrap: requests unavailable", "channel_id", channel.ID, "error", err) @@ -140,7 +157,7 @@ func (h *PortalHandler) GetUserBootstrap(w http.ResponseWriter, r *http.Request) }() go func() { defer wait.Done() - if h.approvalService == nil { + if h.approvalService == nil || !config.PortalModuleEnabled("approvals") { return } actor, err := h.portalApprovalActorFromRequest(r) diff --git a/internal/handlers/public_board.go b/internal/handlers/public_board.go index f8a2a307d..e8ff574ee 100644 --- a/internal/handlers/public_board.go +++ b/internal/handlers/public_board.go @@ -55,22 +55,70 @@ func rewritePublicAttachmentURLs(content, slug string) string { ) } -// PublicBoardHandler serves read-only public board views +// PublicBoardHandler serves read-only public board views. type PublicBoardHandler struct { db database.Database permissionService *services.PermissionService publicBoardScope *services.PublicBoardScopeService storage *blobstore.Store + availability services.PublicBoardAvailability +} + +type portalBoardContextKey struct{} +type portalBoardContext struct { + CollectionID int + AttachmentPrefix string +} + +type publicBoardSource struct { + ID int + Name, Description, Query, UpdatedAt string + Swimlanes bool +} + +func (h *PublicBoardHandler) boardSource(r *http.Request) (*publicBoardSource, error) { + where, value := `public_slug = ? AND is_public = true AND public_slug IS NOT NULL`, any(r.PathValue("slug")) + if placement, ok := r.Context().Value(portalBoardContextKey{}).(portalBoardContext); ok { + where, value = `id = ? AND board_enabled = true`, placement.CollectionID + } + var source publicBoardSource + err := h.db.QueryRowContext(r.Context(), `SELECT id, name, COALESCE(description, ''), COALESCE(ql_query, ''), public_milestone_swimlanes, updated_at FROM collections WHERE `+where+` AND is_private = false AND public_revoked_at IS NULL`, value). + Scan(&source.ID, &source.Name, &source.Description, &source.Query, &source.Swimlanes, &source.UpdatedAt) + return &source, err +} + +func rewriteBoardAttachmentURLs(r *http.Request, content, slug string) string { + if placement, ok := r.Context().Value(portalBoardContextKey{}).(portalBoardContext); ok { + content = strings.ReplaceAll(content, requestContextPrefix(r)+"/api/attachments/", placement.AttachmentPrefix) + return strings.ReplaceAll(content, "/api/attachments/", placement.AttachmentPrefix) + } + return rewritePublicAttachmentURLs(content, slug) } // NewPublicBoardHandler creates a new PublicBoardHandler -func NewPublicBoardHandler(db database.Database, permissionService *services.PermissionService, storage *blobstore.Store) *PublicBoardHandler { - return &PublicBoardHandler{ +func NewPublicBoardHandler(db database.Database, permissionService *services.PermissionService, storage *blobstore.Store, availability ...services.PublicBoardAvailability) *PublicBoardHandler { + h := &PublicBoardHandler{ db: db, permissionService: permissionService, publicBoardScope: services.NewPublicBoardScopeService(db, permissionService), storage: storage, } + if len(availability) > 0 { + h.availability = availability[0] + } + return h +} + +func (h *PublicBoardHandler) available(w http.ResponseWriter, r *http.Request) bool { + if h.availability != nil && !h.availability.PublicBoardsEnabled() { + respondNotFound(w, r, "board") + return false + } + return true +} + +func (h *PublicBoardHandler) SetAvailability(availability services.PublicBoardAvailability) { + h.availability = availability } func isPublicBoardScopeError(err error) bool { @@ -131,6 +179,8 @@ type publicBoardResponse struct { UpdatedAt string `json:"updated_at"` } +type PublicBoardResponse = publicBoardResponse + type publicComment struct { AuthorName string `json:"author_name"` AuthorAvatar string `json:"author_avatar,omitempty"` @@ -161,8 +211,13 @@ type publicItemDetail struct { CreatedAt string `json:"created_at"` } +type PublicBoardItemResponse = publicItemDetail + // GetPublicBoardItem serves a single item detail for a public collection func (h *PublicBoardHandler) GetPublicBoardItem(w http.ResponseWriter, r *http.Request) { + if !h.available(w, r) { + return + } slug := r.PathValue("slug") key := r.PathValue("key") if slug == "" || key == "" { @@ -184,11 +239,7 @@ func (h *PublicBoardHandler) GetPublicBoardItem(w http.ResponseWriter, r *http.R } // Validate slug → public collection - var collectionID int - err = h.db.QueryRow(` - SELECT id FROM collections - WHERE public_slug = ? AND is_public = true AND is_private = false AND public_slug IS NOT NULL - `, slug).Scan(&collectionID) + source, err := h.boardSource(r) if errors.Is(err, sql.ErrNoRows) { respondNotFound(w, r, "board") return @@ -197,6 +248,7 @@ func (h *PublicBoardHandler) GetPublicBoardItem(w http.ResponseWriter, r *http.R respondInternalError(w, r, err) return } + collectionID := source.ID publicItem, err := repository.NewItemRepository(h.db).FindPublicItemByKeyAndNumber(workspaceKey, itemNumber) if err != nil { @@ -227,14 +279,14 @@ func (h *PublicBoardHandler) GetPublicBoardItem(w http.ResponseWriter, r *http.R labels := h.loadSingleItemLabels(itemID) // Load public comments (non-private only) - comments, err := h.loadPublicComments(itemID, slug) + comments, err := h.loadPublicComments(itemID, slug, r) if err != nil { respondInternalError(w, r, err) return } // Rewrite attachment URLs for public access - description = rewritePublicAttachmentURLs(description, slug) + description = rewriteBoardAttachmentURLs(r, description, slug) descriptionHTML, err := markdown.Render(description) if err != nil { respondInternalError(w, r, fmt.Errorf("render public item description: %w", err)) @@ -275,21 +327,16 @@ func (h *PublicBoardHandler) GetPublicBoardItem(w http.ResponseWriter, r *http.R // GetPublicBoard serves a read-only board view for a public collection func (h *PublicBoardHandler) GetPublicBoard(w http.ResponseWriter, r *http.Request) { + if !h.available(w, r) { + return + } slug := r.PathValue("slug") if slug == "" { respondNotFound(w, r, "board") return } - // Look up collection by public_slug where is_public = true - var collectionID int - var collectionName, collectionDescription, qlQuery, updatedAt string - var publicMilestoneSwimlanes bool - err := h.db.QueryRow(` - SELECT id, name, COALESCE(description, ''), COALESCE(ql_query, ''), public_milestone_swimlanes, updated_at - FROM collections - WHERE public_slug = ? AND is_public = true AND is_private = false AND public_slug IS NOT NULL - `, slug).Scan(&collectionID, &collectionName, &collectionDescription, &qlQuery, &publicMilestoneSwimlanes, &updatedAt) + source, err := h.boardSource(r) if errors.Is(err, sql.ErrNoRows) { respondNotFound(w, r, "board") @@ -299,6 +346,7 @@ func (h *PublicBoardHandler) GetPublicBoard(w http.ResponseWriter, r *http.Reque respondInternalError(w, r, err) return } + collectionID, collectionName, collectionDescription, updatedAt, publicMilestoneSwimlanes := source.ID, source.Name, source.Description, source.UpdatedAt, source.Swimlanes // Load board configuration for this collection var boardConfigID int @@ -734,7 +782,7 @@ func (h *PublicBoardHandler) loadSingleItemLabels(itemID int) []publicLabel { return labels } -func (h *PublicBoardHandler) loadPublicComments(itemID int, slug string) ([]publicComment, error) { +func (h *PublicBoardHandler) loadPublicComments(itemID int, slug string, requests ...*http.Request) ([]publicComment, error) { rows, err := h.db.Query(` SELECT COALESCE(u.first_name || ' ' || u.last_name, pc.name, 'Unknown'), COALESCE(u.avatar_url, ''), @@ -756,7 +804,11 @@ func (h *PublicBoardHandler) loadPublicComments(itemID int, slug string) ([]publ if err := rows.Scan(&c.AuthorName, &c.AuthorAvatar, &c.Content, &c.CreatedAt); err != nil { return nil, fmt.Errorf("failed to scan comment: %w", err) } - c.Content = rewritePublicAttachmentURLs(c.Content, slug) + if len(requests) > 0 { + c.Content = rewriteBoardAttachmentURLs(requests[0], c.Content, slug) + } else { + c.Content = rewritePublicAttachmentURLs(c.Content, slug) + } comments = append(comments, c) } if err := rows.Err(); err != nil { @@ -770,6 +822,9 @@ func (h *PublicBoardHandler) loadPublicComments(itemID int, slug string) ([]publ // DownloadAttachment serves an image attachment for a public board item func (h *PublicBoardHandler) DownloadAttachment(w http.ResponseWriter, r *http.Request) { + if !h.available(w, r) { + return + } // Publication and membership are mutable authorization inputs; never cache. w.Header().Set("Cache-Control", "no-store") @@ -787,15 +842,12 @@ func (h *PublicBoardHandler) DownloadAttachment(w http.ResponseWriter, r *http.R } // Validate slug → public collection - var collectionID int - err = h.db.QueryRow(` - SELECT id FROM collections - WHERE public_slug = ? AND is_public = true AND is_private = false AND public_slug IS NOT NULL - `, slug).Scan(&collectionID) + source, err := h.boardSource(r) if err != nil { respondNotFound(w, r, "attachment") return } + collectionID := source.ID // Require an item attachment; legacy rows reuse item_id for other entities. var itemID sql.NullInt64 @@ -804,7 +856,7 @@ func (h *PublicBoardHandler) DownloadAttachment(w http.ResponseWriter, r *http.R var fileSize int64 err = h.db.QueryRow(` SELECT item_id, COALESCE(entity_type, 'item'), file_path, mime_type, original_filename, file_size - FROM attachments WHERE id = ? + FROM attachments WHERE id = ? AND is_internal = false `, attachmentID).Scan(&itemID, &entityType, &filePath, &mimeType, &originalFilename, &fileSize) if err != nil { respondNotFound(w, r, "attachment") diff --git a/internal/handlers/security_settings.go b/internal/handlers/security_settings.go index be1a16d24..84822df73 100644 --- a/internal/handlers/security_settings.go +++ b/internal/handlers/security_settings.go @@ -20,6 +20,7 @@ type SecuritySettingsHandler struct { auditor *logger.Auditor pluginsDisabled bool externalImagesAllowed atomic.Bool + publicBoardsEnabled atomic.Bool } // NewSecuritySettingsHandler creates a new security settings handler @@ -32,9 +33,13 @@ func NewSecuritySettingsHandler(settings *repository.SystemSettingRepository, au if value, ok, err := settings.GetValue("allow_external_images"); err == nil && ok { h.externalImagesAllowed.Store(strings.EqualFold(value, "true")) } + value, exists, err := settings.GetValue("public_boards_enabled") + h.publicBoardsEnabled.Store(err == nil && (!exists || strings.EqualFold(value, "true"))) return h } +func (h *SecuritySettingsHandler) PublicBoardsEnabled() bool { return h.publicBoardsEnabled.Load() } + // ExternalImagesAllowed reports whether CSP may load images from arbitrary // HTTP and HTTPS origins. func (h *SecuritySettingsHandler) ExternalImagesAllowed() bool { @@ -46,6 +51,7 @@ type SecuritySettings struct { CalendarFeedEnabled bool `json:"calendar_feed_enabled"` PluginCLIExecEnabled bool `json:"plugin_cli_exec_enabled"` AllowExternalImages bool `json:"allow_external_images"` + PublicBoardsEnabled bool `json:"public_boards_enabled"` PluginsDisabled bool `json:"plugins_disabled"` APIKeyCreationPolicy string `json:"api_key_creation_policy"` // "all_users", "groups_only", or "disabled" APIKeyAllowedGroupIDs []int `json:"api_key_allowed_group_ids"` // Group IDs when policy = "groups_only" @@ -64,9 +70,10 @@ func (h *SecuritySettingsHandler) GetSecuritySettings(w http.ResponseWriter, r * // previous values for the audit trail. func (h *SecuritySettingsHandler) loadSecuritySettings() SecuritySettings { settings := SecuritySettings{ - CalendarFeedEnabled: true, // Default enabled - PluginCLIExecEnabled: false, // Default disabled for security - AllowExternalImages: false, // Default restricted to approved image origins + CalendarFeedEnabled: true, // Default enabled + PluginCLIExecEnabled: false, // Default disabled for security + AllowExternalImages: false, // Default restricted to approved image origins + PublicBoardsEnabled: true, PluginsDisabled: h.pluginsDisabled, // Read-only, set by startup flag APIKeyCreationPolicy: "all_users", // Default: everyone can create APIKeyAllowedGroupIDs: []int{}, @@ -84,6 +91,9 @@ func (h *SecuritySettingsHandler) loadSecuritySettings() SecuritySettings { if v, ok, _ := h.settings.GetValue("allow_external_images"); ok { settings.AllowExternalImages = strings.EqualFold(v, "true") } + if v, ok, _ := h.settings.GetValue("public_boards_enabled"); ok { + settings.PublicBoardsEnabled = strings.EqualFold(v, "true") + } if v, ok, _ := h.settings.GetValue("api_key_creation_policy"); ok { settings.APIKeyCreationPolicy = v } @@ -110,16 +120,23 @@ func (h *SecuritySettingsHandler) loadSecuritySettings() SecuritySettings { // UpdateSecuritySettings updates security settings func (h *SecuritySettingsHandler) UpdateSecuritySettings(w http.ResponseWriter, r *http.Request) { - settings, ok := decodeJSON[SecuritySettings](w, r) + request, ok := decodeJSON[struct { + SecuritySettings + PublicBoardsEnabled *bool `json:"public_boards_enabled"` + }](w, r) if !ok { return } + settings := request.SecuritySettings + before := h.loadSecuritySettings() + settings.PublicBoardsEnabled = before.PublicBoardsEnabled + if request.PublicBoardsEnabled != nil { + settings.PublicBoardsEnabled = *request.PublicBoardsEnabled + } // Policy is identifier-shaped ("all_users"/"groups_only"/"disabled") // and persisted + echoed verbatim in the settings UI and audit log. sanitize.Apply(&settings.APIKeyCreationPolicy, sanitize.ShortIdentifier) - before := h.loadSecuritySettings() - if err := h.settings.Upsert( "calendar_feed_enabled", boolToString(settings.CalendarFeedEnabled), "boolean", "Allow public calendar feed URLs", "security", @@ -198,6 +215,11 @@ func (h *SecuritySettingsHandler) UpdateSecuritySettings(w http.ResponseWriter, return } h.externalImagesAllowed.Store(settings.AllowExternalImages) + if err := h.settings.Upsert("public_boards_enabled", boolToString(settings.PublicBoardsEnabled), "boolean", "Allow external board publications", "security"); err != nil { + respondInternalError(w, r, err) + return + } + h.publicBoardsEnabled.Store(settings.PublicBoardsEnabled) currentUser := utils.GetCurrentUser(r) if currentUser != nil { @@ -229,6 +251,9 @@ func securitySettingsChanges(before, after SecuritySettings) map[string]any { if before.AllowExternalImages != after.AllowExternalImages { add("allow_external_images", before.AllowExternalImages, after.AllowExternalImages) } + if before.PublicBoardsEnabled != after.PublicBoardsEnabled { + add("public_boards_enabled", before.PublicBoardsEnabled, after.PublicBoardsEnabled) + } if before.APIKeyCreationPolicy != after.APIKeyCreationPolicy { add("api_key_creation_policy", before.APIKeyCreationPolicy, after.APIKeyCreationPolicy) } diff --git a/internal/handlers/shell_bootstrap.go b/internal/handlers/shell_bootstrap.go index 3f974ff2b..97db68761 100644 --- a/internal/handlers/shell_bootstrap.go +++ b/internal/handlers/shell_bootstrap.go @@ -18,6 +18,10 @@ type assetSetCapability interface { ManagesAssetSets(int) (bool, error) } +type boardManagementCapability interface { + OwnsBoardCollections(context.Context, int) (bool, error) +} + // ShellBootstrapHandler composes the capability snapshots needed by the // authenticated application shell. Keeping this as one request prevents every // optional feature from competing for a per-user concurrency slot at login. @@ -30,6 +34,7 @@ type ShellBootstrapHandler struct { hub *HubHandler channels channelManagementCapability staleness *WorkItemStalenessHandler + boards boardManagementCapability } type ShellBootstrapResponse struct { @@ -42,6 +47,7 @@ type ShellBootstrapResponse struct { HasPortals bool `json:"has_portals"` HasActivePortals bool `json:"has_active_portals"` ManagesChannels bool `json:"manages_channels"` + OwnsBoards bool `json:"owns_boards"` WorkItemStaleness services.WorkItemStalenessSettings `json:"work_item_staleness"` } @@ -54,11 +60,16 @@ func NewShellBootstrapHandler( hub *HubHandler, channels channelManagementCapability, staleness *WorkItemStalenessHandler, + boards ...boardManagementCapability, ) *ShellBootstrapHandler { - return &ShellBootstrapHandler{ + h := &ShellBootstrapHandler{ features: features, setup: setup, attachments: attachments, ai: ai, assets: assets, hub: hub, channels: channels, staleness: staleness, } + if len(boards) > 0 { + h.boards = boards[0] + } + return h } func (h *ShellBootstrapHandler) Get(w http.ResponseWriter, r *http.Request) { @@ -138,5 +149,13 @@ func (h *ShellBootstrapHandler) Get(w http.ResponseWriter, r *http.Request) { } } + if h.boards != nil { + owns, err := h.boards.OwnsBoardCollections(r.Context(), user.ID) + if err != nil { + slog.Warn("shell bootstrap: board management availability unavailable", "user_id", user.ID, "error", err) + } else { + response.OwnsBoards = owns + } + } respondJSONOK(w, response) } diff --git a/internal/logger/audit.go b/internal/logger/audit.go index f0ac169c7..abfb12ad9 100644 --- a/internal/logger/audit.go +++ b/internal/logger/audit.go @@ -684,15 +684,16 @@ const ( ActionChannelCategoryDelete = "channel_category.delete" // Channel management - ActionChannelCreate = "channel.create" - ActionChannelUpdate = "channel.update" - ActionChannelDelete = "channel.delete" - ActionChannelActivate = "channel.activate" - ActionChannelDeactivate = "channel.deactivate" - ActionChannelKBPublish = "channel.kb_publish" // Portal knowledge base publish scope changed - ActionCustomerView = "portal_customer.view" // Customer-data detail view - ActionChannelAddManager = "channel.add_manager" - ActionChannelRemoveManager = "channel.remove_manager" + ActionChannelCreate = "channel.create" + ActionChannelUpdate = "channel.update" + ActionChannelExperienceUpdate = "channel.experience_update" + ActionChannelDelete = "channel.delete" + ActionChannelActivate = "channel.activate" + ActionChannelDeactivate = "channel.deactivate" + ActionChannelKBPublish = "channel.kb_publish" // Portal knowledge base publish scope changed + ActionCustomerView = "portal_customer.view" // Customer-data detail view + ActionChannelAddManager = "channel.add_manager" + ActionChannelRemoveManager = "channel.remove_manager" // Attachment settings management ActionAttachmentSettingsUpdate = "attachment_settings.update" @@ -721,9 +722,14 @@ const ( ActionMilestonePageLinkDelete = "milestone_page_link.delete" // Collection management - ActionCollectionCreate = "collection.create" - ActionCollectionUpdate = "collection.update" - ActionCollectionDelete = "collection.delete" + ActionCollectionCreate = "collection.create" + ActionCollectionUpdate = "collection.update" + ActionCollectionSharingUpdate = "collection.sharing_update" + ActionCollectionPublicRevoke = "collection.public_revoke" + ActionCollectionPublicAllowRepublish = "collection.public_allow_republish" + ActionCollectionPlacementUpdate = "collection.placement_update" + ActionCollectionPlacementRemove = "collection.placement_remove" + ActionCollectionDelete = "collection.delete" // Test case management ActionTestCaseCreate = "test_case.create" diff --git a/internal/models/board_publication.go b/internal/models/board_publication.go new file mode 100644 index 000000000..1e02d4544 --- /dev/null +++ b/internal/models/board_publication.go @@ -0,0 +1,16 @@ +package models + +type BoardPlacement struct { + ID string `json:"id"` + CollectionID int `json:"collection_id"` + ChannelID int `json:"channel_id"` + Label string `json:"label"` + DisplayOrder int `json:"display_order"` + Enabled bool `json:"enabled"` + Policy CustomerAccessPolicy `json:"policy"` + Revision int `json:"revision"` + SourceName string `json:"source_name,omitempty"` + BaselinePolicy *CustomerAccessPolicy `json:"baseline_policy,omitempty"` + EffectivePolicy *CustomerAccessPolicy `json:"effective_policy,omitempty"` + StandaloneEnabled bool `json:"standalone_enabled"` +} diff --git a/internal/models/customer_experience.go b/internal/models/customer_experience.go new file mode 100644 index 000000000..47d1caff4 --- /dev/null +++ b/internal/models/customer_experience.go @@ -0,0 +1,32 @@ +package models + +import "slices" + +var PortalModuleKinds = []string{"boards", "requests", "forms", "knowledge-base", "drafts", "approvals", "profile", "asset-reports"} + +func (config ChannelConfig) PortalModuleEnabled(kind string) bool { + return config.PortalModules == nil || slices.Contains(config.PortalModules, kind) +} + +type CustomerExperienceBoard struct { + ID string `json:"id"` + Label string `json:"label"` + DisplayOrder int `json:"display_order"` + PublicationRevision int `json:"publication_revision"` + PlacementRevision int `json:"placement_revision"` +} + +type CustomerExperience struct { + Presentation string `json:"presentation"` + Title string `json:"title"` + LogoURL string `json:"logo_url"` + Slug string `json:"slug"` + Modules []string `json:"modules"` + Navigation []string `json:"navigation"` + DefaultModule string `json:"default_module"` + Boards []CustomerExperienceBoard `json:"boards"` + Authenticated bool `json:"authenticated"` + IsInternal bool `json:"is_internal"` + IdentityKey int `json:"identity_key"` + Revision string `json:"revision"` +} diff --git a/internal/models/item.go b/internal/models/item.go index 4f010e257..cc531cb08 100644 --- a/internal/models/item.go +++ b/internal/models/item.go @@ -474,6 +474,15 @@ type Collection struct { PublicSlug *string `json:"public_slug,omitempty"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` + BoardEnabled bool `json:"board_enabled"` + BoardStandaloneEnabled bool `json:"board_standalone_enabled"` + BoardEverPublished bool `json:"board_ever_published"` + SharingRevision int `json:"sharing_revision"` + PublicRevokedAt *string `json:"public_revoked_at,omitempty"` + PublicRevokedBy *int `json:"public_revoked_by,omitempty"` + PublicRevokeReason string `json:"public_revoke_reason"` + SharingChangedAt *string `json:"sharing_changed_at,omitempty"` + SharingChangedBy *int `json:"sharing_changed_by,omitempty"` // Joined fields for API responses CreatorName string `json:"creator_name,omitempty"` CreatorEmail string `json:"creator_email,omitempty"` diff --git a/internal/models/portal.go b/internal/models/portal.go index 4f884f134..60efd0201 100644 --- a/internal/models/portal.go +++ b/internal/models/portal.go @@ -167,10 +167,14 @@ type ChannelConfig struct { EmailRateLimitPerHour *int `json:"email_rate_limit_per_hour,omitempty"` // Portal Configuration - PortalSlug string `json:"portal_slug,omitempty"` // URL-friendly identifier (e.g., "support-portal") - PortalWorkspaceIDs []int `json:"portal_workspace_ids"` // Target workspaces for submissions - PortalTitle string `json:"portal_title,omitempty"` // Display title for portal - PortalDescription string `json:"portal_description,omitempty"` // Description shown on portal page + PortalSlug string `json:"portal_slug,omitempty"` // URL-friendly identifier (e.g., "support-portal") + PortalWorkspaceIDs []int `json:"portal_workspace_ids"` // Target workspaces for submissions + PortalTitle string `json:"portal_title,omitempty"` // Display title for portal + PortalDescription string `json:"portal_description,omitempty"` // Description shown on portal page + PortalPresentation string `json:"portal_presentation,omitempty"` + PortalModules []string `json:"portal_modules"` + PortalNavigation []string `json:"portal_navigation,omitempty"` + PortalDefaultModule string `json:"portal_default_module,omitempty"` // Portal Registration Controls PortalRegistrationMode string `json:"portal_registration_mode,omitempty"` // "open" (default) or "manual" — manual = only admin-managed customers can sign in diff --git a/internal/repository/audit_log_repository.go b/internal/repository/audit_log_repository.go index 135b63445..9339eba9c 100644 --- a/internal/repository/audit_log_repository.go +++ b/internal/repository/audit_log_repository.go @@ -53,6 +53,8 @@ func (r *AuditLogRepository) Get(id int) (*AuditLogRow, error) { // Zero-valued / nil fields are skipped at WHERE-clause build time. type AuditLogFilters struct { ActionType string // exact match + ActionTypes []string // any of these exact action types + ResourceID *int // exact resource ID, paired with ResourceType UserID *int // exact match (nil = any) ResourceType string // exact match Source string // exact match (USER, SCIM, SYSTEM, ...) @@ -334,6 +336,16 @@ func buildAuditLogWhere(f AuditLogFilters) (whereClause string, args []any) { conditions = append(conditions, "action_type = ?") args = append(args, f.ActionType) } + if len(f.ActionTypes) > 0 { + conditions = append(conditions, "action_type IN ("+strings.TrimSuffix(strings.Repeat("?,", len(f.ActionTypes)), ",")+")") + for _, action := range f.ActionTypes { + args = append(args, action) + } + } + if f.ResourceID != nil { + conditions = append(conditions, "resource_id = ?") + args = append(args, *f.ResourceID) + } if f.UserID != nil { conditions = append(conditions, "user_id = ?") args = append(args, *f.UserID) diff --git a/internal/repository/board_placement_repository.go b/internal/repository/board_placement_repository.go new file mode 100644 index 000000000..3f97592e9 --- /dev/null +++ b/internal/repository/board_placement_repository.go @@ -0,0 +1,56 @@ +package repository + +import ( + "context" + "database/sql" + "encoding/json" + "errors" + + "windshift/internal/database" + "windshift/internal/models" +) + +type BoardPlacementRepository struct{ db database.Database } + +func NewBoardPlacementRepository(db database.Database) *BoardPlacementRepository { + return &BoardPlacementRepository{db: db} +} + +const boardPlacementSelect = `SELECT id, collection_id, channel_id, label, display_order, enabled, access_mode, organisation_ids, revision FROM board_placements` + +func scanBoardPlacement(row interface{ Scan(...any) error }) (*models.BoardPlacement, error) { + var placement models.BoardPlacement + var ids string + err := row.Scan(&placement.ID, &placement.CollectionID, &placement.ChannelID, &placement.Label, &placement.DisplayOrder, &placement.Enabled, &placement.Policy.Mode, &ids, &placement.Revision) + if errors.Is(err, sql.ErrNoRows) { + return nil, ErrNotFound + } + if err != nil { + return nil, err + } + if err := json.Unmarshal([]byte(ids), &placement.Policy.OrganisationIDs); err != nil { + return nil, err + } + return &placement, nil +} + +func (r *BoardPlacementRepository) Get(ctx context.Context, channelID int, id string) (*models.BoardPlacement, error) { + return scanBoardPlacement(r.db.QueryRowContext(ctx, boardPlacementSelect+` WHERE channel_id = ? AND id = ?`, channelID, id)) +} + +func (r *BoardPlacementRepository) List(ctx context.Context, channelID int) ([]models.BoardPlacement, error) { + rows, err := r.db.QueryContext(ctx, boardPlacementSelect+` WHERE channel_id = ? ORDER BY display_order, id`, channelID) + if err != nil { + return nil, err + } + defer func() { _ = rows.Close() }() + items := []models.BoardPlacement{} + for rows.Next() { + item, err := scanBoardPlacement(rows) + if err != nil { + return nil, err + } + items = append(items, *item) + } + return items, rows.Err() +} diff --git a/internal/repository/collection_repository.go b/internal/repository/collection_repository.go index 0de241b8a..fc393a573 100644 --- a/internal/repository/collection_repository.go +++ b/internal/repository/collection_repository.go @@ -1,6 +1,7 @@ package repository import ( + "context" "database/sql" "errors" "fmt" @@ -8,6 +9,7 @@ import ( "time" "windshift/internal/database" + "windshift/internal/logger" "windshift/internal/models" ) @@ -40,7 +42,9 @@ const collectionModelSelect = `SELECT c.id, c.name, COALESCE(c.description, ''), c.filter_state, c.is_public, c.is_private, c.public_milestone_swimlanes, c.workspace_id, c.category_id, c.created_by, c.public_slug, c.created_at, c.updated_at, COALESCE(u.first_name || ' ' || u.last_name, ''), COALESCE(u.email, ''), - COALESCE(cc.name, ''), COALESCE(cc.color, '') + COALESCE(cc.name, ''), COALESCE(cc.color, ''), + c.board_enabled, c.board_standalone_enabled, c.board_ever_published, c.sharing_revision, + c.public_revoked_at, c.public_revoked_by, c.public_revoke_reason, c.sharing_changed_at, c.sharing_changed_by FROM collections c LEFT JOIN users u ON c.created_by = u.id LEFT JOIN collection_categories cc ON c.category_id = cc.id` @@ -60,6 +64,8 @@ func scanCollectionModel(scanner collectionModelScanner) (models.Collection, err &publicSlug, &collection.CreatedAt, &collection.UpdatedAt, &collection.CreatorName, &collection.CreatorEmail, &collection.CategoryName, &collection.CategoryColor, + &collection.BoardEnabled, &collection.BoardStandaloneEnabled, &collection.BoardEverPublished, &collection.SharingRevision, + &collection.PublicRevokedAt, &collection.PublicRevokedBy, &collection.PublicRevokeReason, &collection.SharingChangedAt, &collection.SharingChangedBy, ) if err != nil { return models.Collection{}, err @@ -176,10 +182,10 @@ func (r *CollectionRepository) CreateForImport(collection *models.Collection, us var id int64 err := r.db.QueryRow(` INSERT INTO collections - (name, description, ql_query, filter_state, is_public, is_private, public_milestone_swimlanes, workspace_id, category_id, created_by, public_slug, created_at, updated_at) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id + (name, description, ql_query, filter_state, is_public, is_private, public_milestone_swimlanes, workspace_id, category_id, created_by, public_slug, board_enabled, board_ever_published, created_at, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id `, collection.Name, collection.Description, collection.QLQuery, collection.FilterState, - collection.IsPublic, collection.IsPrivate, collection.PublicMilestoneSwimlanes, collection.WorkspaceID, collection.CategoryID, userID, collection.PublicSlug).Scan(&id) + collection.IsPublic, collection.IsPrivate, collection.PublicMilestoneSwimlanes, collection.WorkspaceID, collection.CategoryID, userID, collection.PublicSlug, collection.IsPublic, collection.IsPublic).Scan(&id) if err != nil { return fmt.Errorf("create imported collection: %w", err) } @@ -216,23 +222,36 @@ func (r *CollectionRepository) CategoryExists(id int) (bool, error) { } // Create inserts a collection and populates its generated ID and owner. -func (r *CollectionRepository) Create(collection *models.Collection, userID int) error { +func (r *CollectionRepository) Create(collection *models.Collection, userID int, auditEvents ...logger.AuditEvent) error { var id int64 - err := r.db.QueryRow(` - INSERT INTO collections (name, description, ql_query, filter_state, is_public, is_private, public_milestone_swimlanes, workspace_id, category_id, created_by, public_slug, created_at, updated_at) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id - `, collection.Name, collection.Description, collection.QLQuery, collection.FilterState, - collection.IsPublic, collection.IsPrivate, collection.PublicMilestoneSwimlanes, collection.WorkspaceID, collection.CategoryID, userID, collection.PublicSlug).Scan(&id) + err := database.WithTx(r.db, func(tx database.Tx) error { + if err := tx.QueryRow(` + INSERT INTO collections (name, description, ql_query, filter_state, is_public, is_private, public_milestone_swimlanes, workspace_id, category_id, created_by, public_slug, board_enabled, board_ever_published, sharing_changed_at, sharing_changed_by, created_at, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP) RETURNING id + `, collection.Name, collection.Description, collection.QLQuery, collection.FilterState, + collection.IsPublic, collection.IsPrivate, collection.PublicMilestoneSwimlanes, collection.WorkspaceID, collection.CategoryID, userID, collection.PublicSlug, collection.IsPublic, collection.IsPublic, collection.SharingChangedAt, collection.SharingChangedBy).Scan(&id); err != nil { + return err + } + collection.ID = int(id) + for _, event := range auditEvents { + if err := logger.LogAuditTx(context.Background(), tx, event); err != nil { + return err + } + } + return nil + }) if err != nil { return fmt.Errorf("create collection: %w", err) } collection.ID = int(id) collection.CreatedBy = &userID + collection.BoardEnabled, collection.BoardEverPublished = collection.IsPublic, collection.IsPublic + collection.BoardStandaloneEnabled, collection.SharingRevision = true, 1 return nil } // Update replaces all editable collection fields. -func (r *CollectionRepository) Update(id int, collection *models.Collection) error { +func (r *CollectionRepository) Update(id int, collection *models.Collection, auditEvents ...logger.AuditEvent) error { err := database.WithTx(r.db, func(tx database.Tx) error { // Serialize scope changes with queue creation. Updating only updated_at // locks the row without firing the collection change trigger, which @@ -248,14 +267,25 @@ func (r *CollectionRepository) Update(id int, collection *models.Collection) err if err != nil { return err } - if _, err := tx.Exec(` + result, err := tx.Exec(` UPDATE collections - SET name = ?, description = ?, ql_query = ?, filter_state = ?, is_public = ?, is_private = ?, public_milestone_swimlanes = ?, workspace_id = ?, category_id = ?, public_slug = ?, updated_at = CURRENT_TIMESTAMP - WHERE id = ? + SET name = ?, description = ?, ql_query = ?, filter_state = ?, is_public = ?, is_private = ?, public_milestone_swimlanes = ?, workspace_id = ?, category_id = ?, public_slug = ?, updated_at = CURRENT_TIMESTAMP, + board_enabled = ?, board_standalone_enabled = ?, board_ever_published = board_ever_published OR ?, sharing_revision = sharing_revision + 1, + sharing_changed_at = ?, sharing_changed_by = ? + WHERE id = ? AND sharing_revision = ? `, collection.Name, collection.Description, collection.QLQuery, collection.FilterState, - collection.IsPublic, collection.IsPrivate, collection.PublicMilestoneSwimlanes, collection.WorkspaceID, collection.CategoryID, collection.PublicSlug, id); err != nil { + collection.IsPublic, collection.IsPrivate, collection.PublicMilestoneSwimlanes, collection.WorkspaceID, collection.CategoryID, collection.PublicSlug, + collection.BoardEnabled, collection.BoardStandaloneEnabled, collection.BoardEnabled, collection.SharingChangedAt, collection.SharingChangedBy, id, collection.SharingRevision) + if err != nil { + return err + } + affected, err := result.RowsAffected() + if err != nil { return err } + if affected != 1 { + return ErrConflict + } // Keep the informational workspace reference on collection-scoped queues // in sync when the collection moves between the workspace and global // scopes. The queue scope itself is the collection id. @@ -274,11 +304,17 @@ func (r *CollectionRepository) Update(id int, collection *models.Collection) err return err } } + for _, event := range auditEvents { + if err := logger.LogAuditTx(context.Background(), tx, event); err != nil { + return err + } + } return nil }) if err != nil { return fmt.Errorf("update collection %d: %w", id, err) } + collection.SharingRevision++ return nil } @@ -288,10 +324,12 @@ func (r *CollectionRepository) Update(id int, collection *models.Collection) err // publish a scope that was never authorized. The bool reports whether the row // still matched. func (r *CollectionRepository) UpdatePublicSharing(id int, isPublic bool, publicSlug *string, publicMilestoneSwimlanes bool, expectedQuery string, expectedWorkspaceID *int) (bool, error) { - query := "UPDATE collections SET is_public = ?, public_slug = ?, public_milestone_swimlanes = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ?" - args := []any{isPublic, publicSlug, publicMilestoneSwimlanes, id} + query := `UPDATE collections SET is_public = ?, board_enabled = ?, board_ever_published = board_ever_published OR ?, + board_standalone_enabled = CASE WHEN ? THEN true ELSE board_standalone_enabled END, + public_slug = ?, public_milestone_swimlanes = ?, sharing_revision = sharing_revision + 1, updated_at = CURRENT_TIMESTAMP WHERE id = ?` + args := []any{isPublic, isPublic, isPublic, isPublic, publicSlug, publicMilestoneSwimlanes, id} if isPublic { - query += " AND COALESCE(ql_query, '') = ? AND COALESCE(workspace_id, 0) = COALESCE(?, 0)" + query += " AND is_private = false AND public_revoked_at IS NULL AND COALESCE(ql_query, '') = ? AND COALESCE(workspace_id, 0) = COALESCE(?, 0)" args = append(args, expectedQuery, expectedWorkspaceID) } result, err := r.db.ExecWrite(query, args...) diff --git a/internal/repository/customer_access_repository.go b/internal/repository/customer_access_repository.go index 2e0b20bb2..f82ce6379 100644 --- a/internal/repository/customer_access_repository.go +++ b/internal/repository/customer_access_repository.go @@ -107,20 +107,20 @@ func (r *CustomerAccessRepository) OrganisationExists(ctx context.Context, id in return exists, err } -func (r *CustomerAccessRepository) SavePolicy(ctx context.Context, surface models.CustomerSurface, policy models.CustomerAccessPolicy) error { +func (r *CustomerAccessRepository) ValidatePolicy(ctx context.Context, policy models.CustomerAccessPolicy) (models.CustomerAccessPolicy, error) { if policy.Mode != "public" && policy.Mode != "organisations" { - return fmt.Errorf("%w: access mode must be public or organisations", ErrCustomerAccessPolicyInvalid) + return policy, fmt.Errorf("%w: access mode must be public or organisations", ErrCustomerAccessPolicyInvalid) } if len(policy.OrganisationIDs) > 100 { - return fmt.Errorf("%w: select at most 100 customer organisations", ErrCustomerAccessPolicyInvalid) + return policy, fmt.Errorf("%w: select at most 100 customer organisations", ErrCustomerAccessPolicyInvalid) } for _, id := range policy.OrganisationIDs { exists, err := r.OrganisationExists(ctx, id) if err != nil { - return err + return policy, err } if id <= 0 || !exists { - return fmt.Errorf("%w: customer organisation %d does not exist", ErrCustomerAccessPolicyInvalid, id) + return policy, fmt.Errorf("%w: customer organisation %d does not exist", ErrCustomerAccessPolicyInvalid, id) } } ids := slices.Clone(policy.OrganisationIDs) @@ -129,7 +129,16 @@ func (r *CustomerAccessRepository) SavePolicy(ctx context.Context, surface model if ids == nil { ids = []int{} } - raw, err := json.Marshal(ids) + policy.OrganisationIDs = ids + return policy, nil +} + +func (r *CustomerAccessRepository) SavePolicy(ctx context.Context, surface models.CustomerSurface, policy models.CustomerAccessPolicy) error { + policy, err := r.ValidatePolicy(ctx, policy) + if err != nil { + return err + } + raw, err := json.Marshal(policy.OrganisationIDs) if err != nil { return err } diff --git a/internal/restapi/v2/audit_coverage.go b/internal/restapi/v2/audit_coverage.go index 147dc9ba3..1e73b7a7b 100644 --- a/internal/restapi/v2/audit_coverage.go +++ b/internal/restapi/v2/audit_coverage.go @@ -8,6 +8,13 @@ package v2 // request middleware flushes it. AuditService: the application service emits the // central audit event with the request actor. AuditExempt: reviewed exemption. var auditSpecRegistry = map[string]AuditKind{ + "putChannelsChannelIdExperience": AuditService, + "postChannelsChannelIdBoardPlacements": AuditService, + "putChannelsChannelIdBoardPlacementsPlacementId": AuditService, + "deleteChannelsChannelIdBoardPlacementsPlacementId": AuditService, + "putBoardPublicationsCollectionId": AuditService, + "postBoardPublicationsCollectionIdRevoke": AuditService, + "postBoardPublicationsCollectionIdAllowRepublish": AuditService, // Public WebAuthn ceremonies create browser sessions, not resource mutations. "postAuthPasskeyStart": AuditExempt, "postAuthPasskeyComplete": AuditExempt, diff --git a/internal/restapi/v2/board_contract_metadata.go b/internal/restapi/v2/board_contract_metadata.go new file mode 100644 index 000000000..415a583a5 --- /dev/null +++ b/internal/restapi/v2/board_contract_metadata.go @@ -0,0 +1,77 @@ +package v2 + +import ( + "net/http" + "slices" + "strings" +) + +func applyBoardContractMetadata(route *Route) { + summary, found := map[string]string{ + "GET /board-publications": "List owned board publications", + "GET /admin/board-publications": "Inventory board publications across all owners", + "GET /board-publications/{collection_id}": "Read board sharing settings", + "PUT /board-publications/{collection_id}": "Save board publication and audience atomically", + "GET /board-publications/{collection_id}/history": "Read board sharing and placement audit history", + "POST /board-publications/{collection_id}/revoke": "Revoke and lock a board publication", + "POST /board-publications/{collection_id}/allow-republish": "Clear a publication lock without republishing", + "GET /channels/{channel_id}/board-placements": "List linked board placements and effective audiences", + "POST /channels/{channel_id}/board-placements": "Link a board publication to a portal", + "PUT /channels/{channel_id}/board-placements/{placement_id}": "Update a portal board placement", + "DELETE /channels/{channel_id}/board-placements/{placement_id}": "Unlink a portal board without deleting its source", + "GET /channels/{channel_id}/experience": "Read portal presentation and capability settings", + "PUT /channels/{channel_id}/experience": "Save revisioned portal experience settings", + "GET /portal/{slug}/experience": "Read the policy-filtered customer experience", + "GET /portal/{slug}/boards/{placement_id}": "Read a board in its linked portal context", + "GET /portal/{slug}/boards/{placement_id}/items/{key}": "Read externally projected board item detail", + "GET /portal/{slug}/boards/{placement_id}/attachments/{id}/download": "Download a visible image in its portal board context", + }[route.Method+" "+route.Path] + if !found { + return + } + route.Tag, route.Summary = "Governance", summary + if strings.HasPrefix(route.Path, "/channels/") { + route.Tag = "Administration" + } + route.Description = summary + ". Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state." + if strings.HasPrefix(route.Path, "/portal/") { + route.Tag = "API" + route.Description = summary + ". Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence." + } + if route.Path == "/admin/board-publications" { + route.Description += " Requires system administrator permission; a publishing permission alone does not grant cross-owner inventory access." + } + for _, name := range []string{"collection_id", "channel_id", "id"} { + if strings.Contains(route.Path, "{"+name+"}") { + upsertParameter(route, ParameterMetadata{Name: name, In: "path", Required: true, Description: "Positive numeric resource identifier.", Schema: map[string]any{"type": "integer", "minimum": 1}}) + } + } + for _, name := range []string{"slug", "placement_id", "key"} { + if strings.Contains(route.Path, "{"+name+"}") { + upsertParameter(route, ParameterMetadata{Name: name, In: "path", Required: true, Description: "Resource key resolved within the requested context.", Schema: map[string]any{"type": "string", "minLength": 1}}) + } + } + if route.Path == "/board-publications" || route.Path == "/admin/board-publications" { + upsertParameter(route, stringQuery("q", "Case-insensitive board name or slug substring.")) + for _, name := range []string{"workspace_id", "owner_id", "organisation_id"} { + upsertParameter(route, positiveIDQuery(name, "Restricts publication metadata to this resource.")) + } + upsertParameter(route, booleanQuery("global", "Only globally scoped collections.", false)) + upsertParameter(route, enumQuery("state", "Publication state.", "all", "enabled", "disabled", "revoked")) + upsertParameter(route, enumQuery("access_mode", "Board baseline audience mode.", "public", "organisations")) + } + if route.Method == http.MethodDelete { + parameter := positiveIDQuery("revision", "Current placement revision; stale revisions return 409.") + parameter.Required = true + upsertParameter(route, parameter) + } + for _, status := range []int{http.StatusBadRequest, http.StatusUnauthorized, http.StatusForbidden, http.StatusNotFound} { + if !slices.Contains(route.DocumentedErrors, status) { + route.DocumentedErrors = append(route.DocumentedErrors, status) + } + } + if route.Method != http.MethodGet && !slices.Contains(route.DocumentedErrors, http.StatusConflict) { + route.DocumentedErrors = append(route.DocumentedErrors, http.StatusConflict) + } + slices.Sort(route.DocumentedErrors) +} diff --git a/internal/restapi/v2/board_placements.go b/internal/restapi/v2/board_placements.go new file mode 100644 index 000000000..9bcc56648 --- /dev/null +++ b/internal/restapi/v2/board_placements.go @@ -0,0 +1,119 @@ +package v2 + +import ( + "context" + "net/http" + "strconv" + + "windshift/internal/models" + "windshift/internal/services" +) + +type boardPlacementApplication interface { + ListBoardPlacements(context.Context, int, int) ([]models.BoardPlacement, error) + SaveBoardPlacement(context.Context, services.AuditActor, int, string, models.BoardPlacement) (*models.BoardPlacement, error) + DeleteBoardPlacement(context.Context, services.AuditActor, int, string, int) error + GetPortalExperienceSettings(context.Context, int, int) (*services.PortalExperienceSettings, error) + SavePortalExperienceSettings(context.Context, services.AuditActor, int, services.PortalExperienceSettings) (*services.PortalExperienceSettings, error) +} + +func registerBoardPlacementRoutes(b *routeBuilder, collections collectionApplication) { + application := func() (boardPlacementApplication, error) { + service, ok := collections.(boardPlacementApplication) + if !ok { + return nil, newError(http.StatusServiceUnavailable, "unavailable", "Board placements are unavailable") + } + return service, nil + } + b.Read("/channels/{channel_id}/experience", AuthAuthenticated, []string{"collections:read"}, func(r *http.Request) (*services.PortalExperienceSettings, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "channel_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.GetPortalExperienceSettings(r.Context(), user.ID, id) + return result, collectionError(err) + }) + b.JSON(http.MethodPut, "/channels/{channel_id}/experience", http.StatusOK, false, AuthAuthenticated, []string{"collections:write"}, func(r *http.Request, input services.PortalExperienceSettings) (*services.PortalExperienceSettings, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "channel_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.SavePortalExperienceSettings(r.Context(), auditActor(r, user), id, input) + return result, collectionError(err) + }) + b.Read("/channels/{channel_id}/board-placements", AuthAuthenticated, []string{"collections:read"}, func(r *http.Request) ([]models.BoardPlacement, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "channel_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.ListBoardPlacements(r.Context(), user.ID, id) + return result, collectionError(err) + }) + for _, entry := range []struct { + method, path string + status int + }{ + {http.MethodPost, "/channels/{channel_id}/board-placements", http.StatusCreated}, + {http.MethodPut, "/channels/{channel_id}/board-placements/{placement_id}", http.StatusOK}, + } { + b.JSON(entry.method, entry.path, entry.status, false, AuthAuthenticated, []string{"collections:write"}, func(r *http.Request, input models.BoardPlacement) (*models.BoardPlacement, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "channel_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.SaveBoardPlacement(r.Context(), auditActor(r, user), id, r.PathValue("placement_id"), input) + return result, collectionError(err) + }) + } + b.Command(http.MethodDelete, "/channels/{channel_id}/board-placements/{placement_id}", AuthAuthenticated, []string{"collections:write"}, func(r *http.Request) error { + user, err := principal(r) + if err != nil { + return err + } + id, err := pathID(r, "channel_id") + if err != nil { + return err + } + revision, err := strconv.Atoi(r.URL.Query().Get("revision")) + if err != nil || revision < 1 { + return newError(http.StatusBadRequest, "invalid_request", "revision is required") + } + service, err := application() + if err != nil { + return err + } + return collectionError(service.DeleteBoardPlacement(r.Context(), auditActor(r, user), id, r.PathValue("placement_id"), revision)) + }) +} diff --git a/internal/restapi/v2/board_publications.go b/internal/restapi/v2/board_publications.go new file mode 100644 index 000000000..3ba3af6f3 --- /dev/null +++ b/internal/restapi/v2/board_publications.go @@ -0,0 +1,130 @@ +package v2 + +import ( + "net/http" + + "windshift/internal/services" +) + +type boardSharingApplication interface { + GetBoardSharing(int, int) (*services.BoardSharing, error) + SaveBoardSharing(services.AuditActor, int, services.BoardSharingSave) (*services.BoardSharing, error) + RevokeBoardSharing(services.AuditActor, int, int, string, bool) (*services.BoardSharing, error) + BoardSharingHistory(int, int) ([]services.BoardSharingEvent, error) + ListBoardPublications(int, services.BoardPublicationFilter) ([]services.BoardSharing, int, error) +} + +func registerBoardPublicationRoutes(b *routeBuilder, collections collectionApplication) { + application := func() (boardSharingApplication, error) { + service, ok := collections.(boardSharingApplication) + if !ok { + return nil, newError(http.StatusServiceUnavailable, "unavailable", "Board sharing is unavailable") + } + return service, nil + } + list := func(adminOnly bool) pageOperation[services.BoardSharing] { + return func(r *http.Request) ([]services.BoardSharing, Pagination, int, error) { + user, err := principal(r) + if err != nil { + return nil, Pagination{}, 0, err + } + page, err := ParsePage(r) + if err != nil { + return nil, page, 0, err + } + service, err := application() + if err != nil { + return nil, page, 0, err + } + workspace, err := optionalPositiveQueryID(r, "workspace_id") + if err != nil { + return nil, page, 0, err + } + owner, err := optionalPositiveQueryID(r, "owner_id") + if err != nil { + return nil, page, 0, err + } + organisation, err := optionalPositiveQueryID(r, "organisation_id") + if err != nil { + return nil, page, 0, err + } + items, total, err := service.ListBoardPublications(user.ID, services.BoardPublicationFilter{ + SystemAdminOnly: adminOnly, + Query: r.URL.Query().Get("q"), State: r.URL.Query().Get("state"), AccessMode: r.URL.Query().Get("access_mode"), + WorkspaceID: workspace, OwnerID: owner, OrganisationID: organisation, Global: r.URL.Query().Get("scope") == "global", Limit: page.PageSize, Offset: page.Offset, + }) + return items, page, total, collectionError(err) + } + } + b.Page("/board-publications", AuthAuthenticated, []string{"collections:read"}, list(false)) + b.Page("/admin/board-publications", AuthAuthenticated, []string{"collections:read"}, list(true)) + b.Read("/board-publications/{collection_id}", AuthAuthenticated, []string{"collections:read"}, func(r *http.Request) (*services.BoardSharing, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "collection_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.GetBoardSharing(user.ID, id) + return result, collectionError(err) + }) + b.JSON(http.MethodPut, "/board-publications/{collection_id}", http.StatusOK, false, AuthAuthenticated, []string{"collections:write"}, func(r *http.Request, input services.BoardSharingSave) (*services.BoardSharing, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "collection_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.SaveBoardSharing(auditActor(r, user), id, input) + return result, collectionError(err) + }) + b.Read("/board-publications/{collection_id}/history", AuthAuthenticated, []string{"collections:read"}, func(r *http.Request) ([]services.BoardSharingEvent, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "collection_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.BoardSharingHistory(user.ID, id) + return result, collectionError(err) + }) + for _, operation := range []string{"revoke", "allow-republish"} { + b.JSON(http.MethodPost, "/board-publications/{collection_id}/"+operation, http.StatusOK, false, AuthAuthenticated, []string{"collections:write"}, func(r *http.Request, input struct { + Revision int `json:"revision"` + Reason string `json:"reason"` + }) (*services.BoardSharing, error) { + user, err := principal(r) + if err != nil { + return nil, err + } + id, err := pathID(r, "collection_id") + if err != nil { + return nil, err + } + service, err := application() + if err != nil { + return nil, err + } + result, err := service.RevokeBoardSharing(auditActor(r, user), id, input.Revision, input.Reason, operation == "allow-republish") + return result, collectionError(err) + }) + } +} diff --git a/internal/restapi/v2/contract-metadata.json b/internal/restapi/v2/contract-metadata.json index 30698aecf..0d82e5de1 100644 --- a/internal/restapi/v2/contract-metadata.json +++ b/internal/restapi/v2/contract-metadata.json @@ -255,6 +255,125 @@ ] } }, + "/admin/board-publications": { + "get": { + "description": "Inventory board publications across all owners. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state. Requires system administrator permission; a publishing permission alone does not grant cross-owner inventory access.", + "parameters": [ + { + "Name": "page", + "In": "query", + "Description": "One-based page number.", + "Required": false, + "Schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "page_size", + "In": "query", + "Description": "Maximum number of resources to return.", + "Required": false, + "Schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "q", + "In": "query", + "Description": "Case-insensitive board name or slug substring.", + "Required": false, + "Schema": { + "type": "string" + } + }, + { + "Name": "workspace_id", + "In": "query", + "Description": "Restricts publication metadata to this resource.", + "Required": false, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "owner_id", + "In": "query", + "Description": "Restricts publication metadata to this resource.", + "Required": false, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "organisation_id", + "In": "query", + "Description": "Restricts publication metadata to this resource.", + "Required": false, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "global", + "In": "query", + "Description": "Only globally scoped collections.", + "Required": false, + "Schema": { + "default": false, + "type": "boolean" + } + }, + { + "Name": "state", + "In": "query", + "Description": "Publication state.", + "Required": false, + "Schema": { + "enum": [ + "all", + "enabled", + "disabled", + "revoked" + ], + "type": "string" + } + }, + { + "Name": "access_mode", + "In": "query", + "Description": "Board baseline audience mode.", + "Required": false, + "Schema": { + "enum": [ + "public", + "organisations" + ], + "type": "string" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "Inventory board publications across all owners", + "tags": [ + "Governance" + ] + } + }, "/admin/groups": { "get": { "description": ". Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", @@ -2840,9 +2959,478 @@ "description": "Update item attachment visibility. The operation uses JSON Merge Patch: omitted fields remain unchanged and documented nullable fields accept null. Unknown fields are rejected.", "parameters": [ { - "Name": "attachment_id", + "Name": "attachment_id", + "In": "path", + "Description": "The attachment identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "413": {}, + "415": {}, + "429": {}, + "500": {} + }, + "summary": "Update item attachment visibility", + "tags": [ + "Work items" + ] + } + }, + "/attachments/{attachment_id}/content": { + "get": { + "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "parameters": [ + { + "Name": "attachment_id", + "In": "path", + "Description": "The attachment identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "Download item attachment", + "tags": [ + "Work items" + ] + } + }, + "/attachments/{attachment_id}/download": { + "get": { + "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "parameters": [ + { + "Name": "attachment_id", + "In": "path", + "Description": "The attachment identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "Download item attachment", + "tags": [ + "Work items" + ] + } + }, + "/attachments/{attachment_id}/thumbnail": { + "get": { + "description": "Get item attachment thumbnail. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "parameters": [ + { + "Name": "attachment_id", + "In": "path", + "Description": "The attachment identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "Get item attachment thumbnail", + "tags": [ + "Work items" + ] + } + }, + "/auth/passkey/complete": { + "post": { + "description": "Complete staff passkey login. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "parameters": [], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "413": {}, + "415": {}, + "429": {}, + "500": {} + }, + "summary": "Complete staff passkey login", + "tags": [ + "Authentication" + ] + } + }, + "/auth/passkey/start": { + "post": { + "description": "Start staff passkey login. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", + "parameters": [], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "413": {}, + "415": {}, + "429": {}, + "500": {} + }, + "summary": "Start staff passkey login", + "tags": [ + "Authentication" + ] + } + }, + "/board-publications": { + "get": { + "description": "List owned board publications. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "page", + "In": "query", + "Description": "One-based page number.", + "Required": false, + "Schema": { + "default": 1, + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "page_size", + "In": "query", + "Description": "Maximum number of resources to return.", + "Required": false, + "Schema": { + "default": 50, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "q", + "In": "query", + "Description": "Case-insensitive board name or slug substring.", + "Required": false, + "Schema": { + "type": "string" + } + }, + { + "Name": "workspace_id", + "In": "query", + "Description": "Restricts publication metadata to this resource.", + "Required": false, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "owner_id", + "In": "query", + "Description": "Restricts publication metadata to this resource.", + "Required": false, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "organisation_id", + "In": "query", + "Description": "Restricts publication metadata to this resource.", + "Required": false, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "global", + "In": "query", + "Description": "Only globally scoped collections.", + "Required": false, + "Schema": { + "default": false, + "type": "boolean" + } + }, + { + "Name": "state", + "In": "query", + "Description": "Publication state.", + "Required": false, + "Schema": { + "enum": [ + "all", + "enabled", + "disabled", + "revoked" + ], + "type": "string" + } + }, + { + "Name": "access_mode", + "In": "query", + "Description": "Board baseline audience mode.", + "Required": false, + "Schema": { + "enum": [ + "public", + "organisations" + ], + "type": "string" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "List owned board publications", + "tags": [ + "Governance" + ] + } + }, + "/board-publications/{collection_id}": { + "get": { + "description": "Read board sharing settings. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "collection_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "Read board sharing settings", + "tags": [ + "Governance" + ] + }, + "put": { + "description": "Save board publication and audience atomically. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "collection_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "409": {}, + "413": {}, + "415": {}, + "429": {}, + "500": {} + }, + "summary": "Save board publication and audience atomically", + "tags": [ + "Governance" + ] + } + }, + "/board-publications/{collection_id}/allow-republish": { + "post": { + "description": "Clear a publication lock without republishing. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "collection_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "409": {}, + "413": {}, + "415": {}, + "429": {}, + "500": {} + }, + "summary": "Clear a publication lock without republishing", + "tags": [ + "Governance" + ] + } + }, + "/board-publications/{collection_id}/history": { + "get": { + "description": "Read board sharing and placement audit history. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "collection_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "Read board sharing and placement audit history", + "tags": [ + "Governance" + ] + } + }, + "/board-publications/{collection_id}/revoke": { + "post": { + "description": "Revoke and lock a board publication. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "collection_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "409": {}, + "413": {}, + "415": {}, + "429": {}, + "500": {} + }, + "summary": "Revoke and lock a board publication", + "tags": [ + "Governance" + ] + } + }, + "/catalogs/global-bootstrap": { + "get": { + "description": "Load global reference catalogs. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "parameters": [], + "responses": { + "401": {}, + "403": {}, + "429": {}, + "500": {} + }, + "summary": "Load global reference catalogs", + "tags": [ + "Workspace configuration" + ] + } + }, + "/channels/{channel_id}/board-placements": { + "get": { + "description": "List linked board placements and effective audiences. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "channel_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "429": {}, + "500": {} + }, + "summary": "List linked board placements and effective audiences", + "tags": [ + "Administration" + ] + }, + "post": { + "description": "Link a board publication to a portal. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "channel_id", "In": "path", - "Description": "The attachment identifier.", + "Description": "Positive numeric resource identifier.", "Required": true, "Schema": { "minimum": 1, @@ -2855,25 +3443,46 @@ "401": {}, "403": {}, "404": {}, + "409": {}, "413": {}, "415": {}, "429": {}, "500": {} }, - "summary": "Update item attachment visibility", + "summary": "Link a board publication to a portal", "tags": [ - "Work items" + "Administration" ] } }, - "/attachments/{attachment_id}/content": { - "get": { - "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "/channels/{channel_id}/board-placements/{placement_id}": { + "delete": { + "description": "Unlink a portal board without deleting its source. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", "parameters": [ { - "Name": "attachment_id", + "Name": "channel_id", "In": "path", - "Description": "The attachment identifier.", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "placement_id", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + }, + { + "Name": "revision", + "In": "query", + "Description": "Current placement revision; stale revisions return 409.", "Required": true, "Schema": { "minimum": 1, @@ -2882,54 +3491,68 @@ } ], "responses": { + "400": {}, "401": {}, "403": {}, "404": {}, + "409": {}, "429": {}, "500": {} }, - "summary": "Download item attachment", + "summary": "Unlink a portal board without deleting its source", "tags": [ - "Work items" + "Administration" ] - } - }, - "/attachments/{attachment_id}/download": { - "get": { - "description": "Download item attachment. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + }, + "put": { + "description": "Update a portal board placement. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", "parameters": [ { - "Name": "attachment_id", + "Name": "channel_id", "In": "path", - "Description": "The attachment identifier.", + "Description": "Positive numeric resource identifier.", "Required": true, "Schema": { "minimum": 1, "type": "integer" } + }, + { + "Name": "placement_id", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } } ], "responses": { + "400": {}, "401": {}, "403": {}, "404": {}, + "409": {}, + "413": {}, + "415": {}, "429": {}, "500": {} }, - "summary": "Download item attachment", + "summary": "Update a portal board placement", "tags": [ - "Work items" + "Administration" ] } }, - "/attachments/{attachment_id}/thumbnail": { + "/channels/{channel_id}/experience": { "get": { - "description": "Get item attachment thumbnail. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", + "description": "Read portal presentation and capability settings. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", "parameters": [ { - "Name": "attachment_id", + "Name": "channel_id", "In": "path", - "Description": "The attachment identifier.", + "Description": "Positive numeric resource identifier.", "Required": true, "Schema": { "minimum": 1, @@ -2937,72 +3560,47 @@ } } ], - "responses": { - "401": {}, - "403": {}, - "404": {}, - "429": {}, - "500": {} - }, - "summary": "Get item attachment thumbnail", - "tags": [ - "Work items" - ] - } - }, - "/auth/passkey/complete": { - "post": { - "description": "Complete staff passkey login. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "parameters": [], "responses": { "400": {}, "401": {}, "403": {}, "404": {}, - "413": {}, - "415": {}, "429": {}, "500": {} }, - "summary": "Complete staff passkey login", + "summary": "Read portal presentation and capability settings", "tags": [ - "Authentication" + "Administration" ] - } - }, - "/auth/passkey/start": { - "post": { - "description": "Start staff passkey login. The server validates resource ownership and command preconditions before persisting changes. Unknown JSON fields are rejected when the operation accepts a body.", - "parameters": [], + }, + "put": { + "description": "Save revisioned portal experience settings. Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state.", + "parameters": [ + { + "Name": "channel_id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + } + ], "responses": { "400": {}, "401": {}, "403": {}, "404": {}, + "409": {}, "413": {}, "415": {}, "429": {}, "500": {} }, - "summary": "Start staff passkey login", - "tags": [ - "Authentication" - ] - } - }, - "/catalogs/global-bootstrap": { - "get": { - "description": "Load global reference catalogs. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", - "parameters": [], - "responses": { - "401": {}, - "403": {}, - "429": {}, - "500": {} - }, - "summary": "Load global reference catalogs", + "summary": "Save revisioned portal experience settings", "tags": [ - "Workspace configuration" + "Administration" ] } }, @@ -9359,6 +9957,168 @@ ] } }, + "/portal/{slug}/boards/{placement_id}": { + "get": { + "description": "Read a board in its linked portal context. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "parameters": [ + { + "Name": "slug", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + }, + { + "Name": "placement_id", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "500": {} + }, + "summary": "Read a board in its linked portal context", + "tags": [ + "API" + ] + } + }, + "/portal/{slug}/boards/{placement_id}/attachments/{id}/download": { + "get": { + "description": "Download a visible image in its portal board context. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "parameters": [ + { + "Name": "id", + "In": "path", + "Description": "Positive numeric resource identifier.", + "Required": true, + "Schema": { + "minimum": 1, + "type": "integer" + } + }, + { + "Name": "slug", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + }, + { + "Name": "placement_id", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "500": {} + }, + "summary": "Download a visible image in its portal board context", + "tags": [ + "API" + ] + } + }, + "/portal/{slug}/boards/{placement_id}/items/{key}": { + "get": { + "description": "Read externally projected board item detail. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "parameters": [ + { + "Name": "slug", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + }, + { + "Name": "placement_id", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + }, + { + "Name": "key", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "500": {} + }, + "summary": "Read externally projected board item detail", + "tags": [ + "API" + ] + } + }, + "/portal/{slug}/experience": { + "get": { + "description": "Read the policy-filtered customer experience. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "parameters": [ + { + "Name": "slug", + "In": "path", + "Description": "Resource key resolved within the requested context.", + "Required": true, + "Schema": { + "minLength": 1, + "type": "string" + } + } + ], + "responses": { + "400": {}, + "401": {}, + "403": {}, + "404": {}, + "500": {} + }, + "summary": "Read the policy-filtered customer experience", + "tags": [ + "API" + ] + } + }, "/priorities": { "get": { "description": "List priorities. Results include only resources visible to the authenticated caller; collections use their documented stable order and bounds.", diff --git a/internal/restapi/v2/customer_access.go b/internal/restapi/v2/customer_access.go index c6ff774cd..2202fece7 100644 --- a/internal/restapi/v2/customer_access.go +++ b/internal/restapi/v2/customer_access.go @@ -15,21 +15,67 @@ type loginHTTPResponse struct { header http.Header status int body bytes.Buffer + target http.ResponseWriter } func (w *loginHTTPResponse) Header() http.Header { return w.header } func (w *loginHTTPResponse) WriteHeader(status int) { if w.status == 0 { w.status = status + if w.target != nil && status < 400 { + for key, values := range w.header { + for _, value := range values { + w.target.Header().Add(key, value) + } + } + w.target.WriteHeader(status) + } } } func (w *loginHTTPResponse) Write(body []byte) (int, error) { if w.status == 0 { - w.status = http.StatusOK + w.WriteHeader(http.StatusOK) + } + if w.target != nil && w.status < 400 { + return w.target.Write(body) } return w.body.Write(body) } +func adaptCustomerContent(w http.ResponseWriter, r *http.Request, operation func(http.ResponseWriter, *http.Request)) error { + response := &loginHTTPResponse{header: make(http.Header), target: w} + response.header.Set("Cache-Control", "private, no-store") + operation(response, r) + if response.status < 400 { + return nil + } + for key, values := range response.header { + for _, value := range values { + w.Header().Add(key, value) + } + } + var body struct{ Error, Message, Code string } + if err := json.Unmarshal(response.body.Bytes(), &body); err != nil { + return internalError(err) + } + if body.Error == "" { + body.Error = body.Message + } + if body.Code == "" { + switch response.status { + case http.StatusNotFound: + body.Code = "not_found" + case http.StatusForbidden: + body.Code = "permission_denied" + case http.StatusUnauthorized: + body.Code = "authentication_required" + default: + body.Code = "customer_access_failed" + } + } + return newError(response.status, strings.ToLower(body.Code), body.Error) +} + type customerAccessHTTP interface { Status(http.ResponseWriter, *http.Request) GetPolicy(http.ResponseWriter, *http.Request) diff --git a/internal/restapi/v2/portal_boards.go b/internal/restapi/v2/portal_boards.go new file mode 100644 index 000000000..7b317fee7 --- /dev/null +++ b/internal/restapi/v2/portal_boards.go @@ -0,0 +1,37 @@ +package v2 + +import ( + "net/http" + + "windshift/internal/handlers" + "windshift/internal/models" +) + +type portalBoardHTTP interface { + GetPortalExperience(http.ResponseWriter, *http.Request) + GetPortalBoard(http.ResponseWriter, *http.Request) + GetPortalBoardItem(http.ResponseWriter, *http.Request) + DownloadPortalBoardAttachment(http.ResponseWriter, *http.Request) +} + +func registerPortalBoardRoutes(b *routeBuilder, deps Deps) { + wrap := func(operation func(portalBoardHTTP, http.ResponseWriter, *http.Request)) Handler { + return func(w http.ResponseWriter, r *http.Request) error { + h, ok := deps.CustomerAccess.(portalBoardHTTP) + if !ok { + return newError(http.StatusNotFound, "not_found", "Board was not found") + } + return adaptCustomerContent(w, r, func(writer http.ResponseWriter, request *http.Request) { operation(h, writer, request) }) + } + } + b.sessionOnly(func() { + b.RawResponse[models.CustomerExperience](http.MethodGet, "/portal/{slug}/experience", http.StatusOK, "application/json", AuthPublic, nil, + wrap(func(h portalBoardHTTP, w http.ResponseWriter, r *http.Request) { h.GetPortalExperience(w, r) })) + b.RawResponse[handlers.PublicBoardResponse](http.MethodGet, "/portal/{slug}/boards/{placement_id}", http.StatusOK, "application/json", AuthPublic, nil, + wrap(func(h portalBoardHTTP, w http.ResponseWriter, r *http.Request) { h.GetPortalBoard(w, r) })) + b.RawResponse[handlers.PublicBoardItemResponse](http.MethodGet, "/portal/{slug}/boards/{placement_id}/items/{key}", http.StatusOK, "application/json", AuthPublic, nil, + wrap(func(h portalBoardHTTP, w http.ResponseWriter, r *http.Request) { h.GetPortalBoardItem(w, r) })) + b.RawHandler(http.MethodGet, "/portal/{slug}/boards/{placement_id}/attachments/{id}/download", "application/octet-stream", http.StatusOK, AuthPublic, nil, + wrap(func(h portalBoardHTTP, w http.ResponseWriter, r *http.Request) { h.DownloadPortalBoardAttachment(w, r) })) + }) +} diff --git a/internal/restapi/v2/router.go b/internal/restapi/v2/router.go index 271185a00..655ed61ec 100644 --- a/internal/restapi/v2/router.go +++ b/internal/restapi/v2/router.go @@ -961,6 +961,9 @@ func buildRoutes(deps Deps) []route { registerCommentRoutes(&builder, deps) registerAttachmentRoutes(&builder, deps) registerCollectionRoutes(&builder, deps.Collections) + registerBoardPublicationRoutes(&builder, deps.Collections) + registerBoardPlacementRoutes(&builder, deps.Collections) + registerPortalBoardRoutes(&builder, deps) registerCustomerAccessRoutes(&builder, deps) registerPasskeyLoginRoutes(&builder, deps) registerPlanningRoutes(&builder, deps.Planning) @@ -1057,6 +1060,7 @@ func applyEmbeddedContractMetadata(routes []route, document []byte) { } slices.Sort(routes[index].DocumentedErrors) applyParameterCorrections(&routes[index].Route) + applyBoardContractMetadata(&routes[index].Route) } } diff --git a/internal/server/server.go b/internal/server/server.go index 8d8bd9fba..93d817ef7 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -862,6 +862,7 @@ func (s *Server) initialize() error { reviewHandler := handlers.NewReviewHandler(s.db, permService) calendarFeedHandler := handlers.NewCalendarFeedHandler(s.db, permService, cfg.BaseURL) securitySettingsHandler := handlers.NewSecuritySettingsHandler(repository.NewSystemSettingRepository(s.db), logger.NewAuditor(s.db), cfg.Plugins.Disabled) + publicBoardHandler.SetAvailability(securitySettingsHandler) // WI-87/88/89/90 coding-agent harness stack lands later in the // constructor — see the block right after the SCM handlers are @@ -1434,6 +1435,9 @@ func (s *Server) initialize() error { Scope: services.NewPublicBoardScopeService(s.db, permService), PortalSessions: portalSessionManager, PortalAuth: portalAuthHandler, Passkeys: portalWebAuthnHandler, MagicLinks: magicLinkService, IP: ipExtractor, Secure: enableHTTPS || strings.HasPrefix(baseURL, "https://"), + PublicBoards: securitySettingsHandler, + Sharing: services.NewCollectionApplicationService(s.db, permService, securitySettingsHandler), + BoardViewer: publicBoardHandler, }) customerAccessHandler.SetLimiter(s.customerAccessLimiter) ssoHandler.SetCustomerAccess(customerAccessHandler) @@ -1626,6 +1630,7 @@ func (s *Server) initialize() error { hubHandler, channelService, workItemStalenessHandler, + services.NewCollectionApplicationService(s.db, permService, securitySettingsHandler), ) s.briefingScheduler = scheduler.NewBriefingScheduler(s.db, llmManager, permService, timePermissionService, services.NewUserReadService(s.db), promptStore) @@ -2100,7 +2105,7 @@ func (s *Server) initialize() error { CommentAccess: permService, Attachments: services.NewItemAttachmentService(s.db, attachmentStorage, permService), PageAttachments: services.NewPageAttachmentUploadService(s.db, attachmentStorage, permService, pagePermissionService), - Collections: services.NewCollectionApplicationService(s.db, permService), + Collections: services.NewCollectionApplicationService(s.db, permService, securitySettingsHandler).WithSharingNotifications(s.notificationService), Planning: planningApplication, MilestoneComments: milestoneCommentService, MilestonePageLinks: milestonePageLinkService, diff --git a/internal/services/board_placement_service.go b/internal/services/board_placement_service.go new file mode 100644 index 000000000..10bf33fa5 --- /dev/null +++ b/internal/services/board_placement_service.go @@ -0,0 +1,212 @@ +package services + +import ( + "context" + "encoding/json" + "errors" + "slices" + "strings" + + "github.com/google/uuid" + + "windshift/internal/database" + "windshift/internal/logger" + "windshift/internal/models" + "windshift/internal/repository" + "windshift/internal/sanitize" +) + +func (s *CollectionApplicationService) requirePortalManager(ctx context.Context, userID, channelID int) error { + repo := repository.NewChannelRepository(s.db) + channel, err := repo.FindByID(ctx, channelID) + if errors.Is(err, repository.ErrNotFound) { + return ErrCollectionNotFound + } + if err != nil { + return err + } + if channel.Type != "portal" { + return collectionValidation("board placements require a portal channel") + } + admin, err := s.permissions.IsSystemAdmin(userID) + if err != nil { + return err + } + if admin { + return nil + } + allowed, err := repo.UserCanManage(ctx, userID, channelID) + if err != nil { + return err + } + if !allowed { + return ErrCollectionForbidden + } + return nil +} + +func (s *CollectionApplicationService) ListBoardPlacements(ctx context.Context, userID, channelID int) ([]models.BoardPlacement, error) { + if err := s.requirePortalManager(ctx, userID, channelID); err != nil { + return nil, err + } + items, err := repository.NewBoardPlacementRepository(s.db).List(ctx, channelID) + if err != nil { + return nil, err + } + ids := make([]int, 0, len(items)) + for _, item := range items { + ids = append(ids, item.CollectionID) + } + enabled, err := s.boardsEnabled() + if err != nil { + return nil, err + } + boards, err := s.boardSharingRows(ids, false, enabled) + if err != nil { + return nil, err + } + policy, err := repository.NewCustomerAccessRepository(s.db).Policy(ctx, "portal", channelID) + if err != nil { + return nil, err + } + for i := range items { + for _, board := range boards { + if board.CollectionID != items[i].CollectionID { + continue + } + baseline := board.Policy + effective := intersectBoardPolicies(baseline, policy, items[i].Policy) + items[i].SourceName, items[i].BaselinePolicy, items[i].EffectivePolicy, items[i].StandaloneEnabled = board.Name, &baseline, &effective, board.StandaloneEnabled + break + } + } + return items, nil +} + +func (s *CollectionApplicationService) SaveBoardPlacement(ctx context.Context, actor AuditActor, channelID int, id string, input models.BoardPlacement) (*models.BoardPlacement, error) { + // Management summaries are read-only projections, not caller-controlled publication fields. + input.SourceName, input.BaselinePolicy, input.EffectivePolicy, input.StandaloneEnabled = "", nil, nil, false + if err := s.requirePortalManager(ctx, actor.UserID, channelID); err != nil { + return nil, err + } + input.Label = sanitize.PlainTextField.Sanitize(strings.TrimSpace(input.Label)) + if input.Label == "" || len(input.Label) > 200 { + return nil, collectionValidation("placement label must be 1-200 characters") + } + policy, err := repository.NewCustomerAccessRepository(s.db).ValidatePolicy(ctx, input.Policy) + if err != nil { + return nil, collectionValidation(err.Error()) + } + input.Policy = policy + repo := repository.NewBoardPlacementRepository(s.db) + var before *models.BoardPlacement + if id == "" { + if input.Revision != 0 { + return nil, collectionValidation("new placements must omit revision") + } + if _, _, err := s.sharingCollection(actor.UserID, input.CollectionID); err != nil { + return nil, err + } + if err := s.validatePublicPermission(actor.UserID, true); err != nil { + return nil, err + } + id = uuid.NewString() + } else { + before, err = repo.Get(ctx, channelID, id) + if errors.Is(err, repository.ErrNotFound) { + return nil, ErrCollectionNotFound + } + if err != nil { + return nil, err + } + if before.CollectionID != input.CollectionID { + return nil, collectionValidation("a placement cannot change its publication") + } + if before.Revision != input.Revision { + return nil, ErrCollectionConflict + } + _, _, boardErr := s.sharingCollection(actor.UserID, input.CollectionID) + if boardErr != nil && !errors.Is(boardErr, ErrCollectionForbidden) { + return nil, boardErr + } + if boardErr != nil && !policyNarrows(before.Policy, policy) { + return nil, ErrCollectionForbidden + } + } + input.ID, input.ChannelID, input.Revision = id, channelID, input.Revision+1 + raw, err := json.Marshal(policy.OrganisationIDs) + if err != nil { + return nil, err + } + err = database.WithTx(s.db, func(tx database.Tx) error { + if before == nil { + _, err = tx.Exec(`INSERT INTO board_placements (id, collection_id, channel_id, label, display_order, enabled, access_mode, organisation_ids, revision) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, + id, input.CollectionID, channelID, input.Label, input.DisplayOrder, input.Enabled, policy.Mode, string(raw), input.Revision) + } else { + result, writeErr := tx.Exec(`UPDATE board_placements SET label = ?, display_order = ?, enabled = ?, access_mode = ?, organisation_ids = ?, revision = revision + 1 WHERE id = ? AND channel_id = ? AND revision = ?`, + input.Label, input.DisplayOrder, input.Enabled, policy.Mode, string(raw), id, channelID, before.Revision) + if writeErr != nil { + return writeErr + } + count, writeErr := result.RowsAffected() + if writeErr != nil { + return writeErr + } + if count != 1 { + return ErrCollectionConflict + } + } + if err != nil { + return err + } + return logger.LogAuditTx(ctx, tx, logger.AuditEvent{UserID: actor.UserID, Username: actor.Username, IPAddress: actor.IPAddress, UserAgent: actor.UserAgent, + Source: actor.Source, ActionType: logger.ActionCollectionPlacementUpdate, ResourceType: logger.ResourceCollection, ResourceID: &input.CollectionID, Success: true, + Details: map[string]any{"before": before, "after": input, "portal_id": channelID, "placement_id": id}}) + }) + if database.IsUniqueConstraintError(err) { + return nil, ErrCollectionConflict + } + if err != nil { + return nil, err + } + return &input, nil +} + +func policyNarrows(before, after models.CustomerAccessPolicy) bool { + if before.Mode == "public" { + return true + } + if after.Mode != "organisations" { + return false + } + return !slices.ContainsFunc(after.OrganisationIDs, func(id int) bool { return !slices.Contains(before.OrganisationIDs, id) }) +} + +func (s *CollectionApplicationService) DeleteBoardPlacement(ctx context.Context, actor AuditActor, channelID int, id string, revision int) error { + if err := s.requirePortalManager(ctx, actor.UserID, channelID); err != nil { + return err + } + before, err := repository.NewBoardPlacementRepository(s.db).Get(ctx, channelID, id) + if errors.Is(err, repository.ErrNotFound) { + return ErrCollectionNotFound + } + if err != nil { + return err + } + return database.WithTx(s.db, func(tx database.Tx) error { + result, err := tx.Exec(`DELETE FROM board_placements WHERE id = ? AND channel_id = ? AND revision = ?`, id, channelID, revision) + if err != nil { + return err + } + count, err := result.RowsAffected() + if err != nil { + return err + } + if count != 1 { + return ErrCollectionConflict + } + return logger.LogAuditTx(ctx, tx, logger.AuditEvent{UserID: actor.UserID, Username: actor.Username, IPAddress: actor.IPAddress, UserAgent: actor.UserAgent, + Source: actor.Source, ActionType: logger.ActionCollectionPlacementRemove, ResourceType: logger.ResourceCollection, ResourceID: &before.CollectionID, Success: true, + Details: map[string]any{"before": before, "portal_id": channelID, "placement_id": id}}) + }) +} diff --git a/internal/services/board_publication_inventory.go b/internal/services/board_publication_inventory.go new file mode 100644 index 000000000..5d9d9a500 --- /dev/null +++ b/internal/services/board_publication_inventory.go @@ -0,0 +1,203 @@ +package services + +import ( + "encoding/json" + "net/url" + "slices" + + "windshift/internal/models" +) + +type BoardAudienceOrganisation struct { + ID int `json:"id"` + Name string `json:"name"` +} + +type BoardPublicationLocation struct { + Kind string `json:"kind"` + Label string `json:"label"` + URL string `json:"url"` + ChannelID *int `json:"channel_id"` + Enabled bool `json:"enabled"` + EffectivePolicy models.CustomerAccessPolicy `json:"effective_policy"` +} + +// Intersect policies across locations; IDs are any-of within each policy. +func intersectBoardPolicies(policies ...models.CustomerAccessPolicy) models.CustomerAccessPolicy { + result := models.CustomerAccessPolicy{Mode: "public", OrganisationIDs: []int{}} + for _, policy := range policies { + if policy.Mode == "public" { + continue + } + if result.Mode == "public" { + result.Mode = "organisations" + result.OrganisationIDs = slices.Clone(policy.OrganisationIDs) + continue + } + result.OrganisationIDs = slices.DeleteFunc(result.OrganisationIDs, func(id int) bool { return !slices.Contains(policy.OrganisationIDs, id) }) + } + return result +} + +// Load page metadata in batches, never fetching board content or performing per-row reads. +func (s *CollectionApplicationService) boardSharingRows(ids []int, admin, instanceEnabled bool) ([]BoardSharing, error) { + items := make([]BoardSharing, 0, len(ids)) + if len(ids) == 0 { + return items, nil + } + placeholders, args := sqlPlaceholders(ids) + rows, err := s.db.Query(`SELECT c.id, c.name, c.created_by, COALESCE(NULLIF(TRIM(u.first_name || ' ' || u.last_name), ''), u.username, ''), u.is_active, + c.workspace_id, COALESCE(w.name, ''), COALESCE(c.ql_query, ''), c.board_enabled, c.board_standalone_enabled, + c.public_slug, c.public_milestone_swimlanes, COALESCE(a.mode, 'public'), COALESCE(a.organisation_ids, '[]'), + c.sharing_revision, c.public_revoked_at, c.public_revoke_reason, c.sharing_changed_at, c.sharing_changed_by, + COALESCE(NULLIF(TRIM(actor.first_name || ' ' || actor.last_name), ''), actor.username, '') + FROM collections c LEFT JOIN users u ON u.id = c.created_by LEFT JOIN workspaces w ON w.id = c.workspace_id + LEFT JOIN users actor ON actor.id = c.sharing_changed_by + LEFT JOIN customer_resource_access a ON a.resource_kind = 'board' AND a.resource_id = c.id + WHERE c.id IN (`+placeholders+`)`, args...) + if err != nil { + return nil, err + } + byID := map[int]int{} + for rows.Next() { + var item BoardSharing + var raw string + err := rows.Scan(&item.CollectionID, &item.Name, &item.OwnerID, &item.OwnerName, &item.OwnerActive, + &item.WorkspaceID, &item.WorkspaceName, &item.Scope, &item.Enabled, &item.StandaloneEnabled, &item.Slug, + &item.MilestoneSwimlanes, &item.Policy.Mode, &raw, &item.Revision, &item.RevokedAt, &item.RevokeReason, + &item.ChangedAt, &item.ChangedBy, &item.ChangedByName) + if err != nil { + _ = rows.Close() + return nil, err + } + if err := json.Unmarshal([]byte(raw), &item.Policy.OrganisationIDs); err != nil { + _ = rows.Close() + return nil, err + } + item.CanAdminister, item.InstanceEnabled = admin, instanceEnabled + item.Organizations, item.Locations = []BoardAudienceOrganisation{}, []BoardPublicationLocation{} + if item.StandaloneEnabled && item.Slug != nil { + item.Locations = append(item.Locations, BoardPublicationLocation{Kind: "standalone", Label: "Standalone", URL: "/board/" + url.PathEscape(*item.Slug), + Enabled: instanceEnabled && item.Enabled && item.RevokedAt == nil, EffectivePolicy: item.Policy}) + } + byID[item.CollectionID] = len(items) + items = append(items, item) + } + err = rows.Err() + _ = rows.Close() + if err != nil { + return nil, err + } + placements, err := s.db.Query(`SELECT p.collection_id, p.id, p.channel_id, ch.name, ch.status, COALESCE(ch.config, '{}'), + p.label, p.enabled, p.access_mode, p.organisation_ids, COALESCE(a.mode, 'public'), COALESCE(a.organisation_ids, '[]') + FROM board_placements p JOIN channels ch ON ch.id = p.channel_id + LEFT JOIN customer_resource_access a ON a.resource_kind = 'portal' AND a.resource_id = p.channel_id + WHERE p.collection_id IN (`+placeholders+`) ORDER BY p.display_order, p.id`, args...) + if err != nil { + return nil, err + } + for placements.Next() { + var collectionID, channelID int + var id, name, status, rawConfig, label, placementIDs, portalIDs string + var enabled bool + var placementPolicy, portalPolicy models.CustomerAccessPolicy + err := placements.Scan(&collectionID, &id, &channelID, &name, &status, &rawConfig, &label, &enabled, &placementPolicy.Mode, &placementIDs, &portalPolicy.Mode, &portalIDs) + if err != nil { + _ = placements.Close() + return nil, err + } + var config models.ChannelConfig + for _, value := range []struct { + raw string + target any + }{{rawConfig, &config}, {placementIDs, &placementPolicy.OrganisationIDs}, {portalIDs, &portalPolicy.OrganisationIDs}} { + if err := json.Unmarshal([]byte(value.raw), value.target); err != nil { + _ = placements.Close() + return nil, err + } + } + index, found := byID[collectionID] + if !found { + continue + } + item := &items[index] + item.Locations = append(item.Locations, BoardPublicationLocation{Kind: "portal", Label: name + " / " + label, ChannelID: &channelID, + URL: "/portal/" + url.PathEscape(config.PortalSlug) + "/boards/" + url.PathEscape(id), + Enabled: instanceEnabled && item.Enabled && item.RevokedAt == nil && enabled && status == "enabled" && config.PortalModuleEnabled("boards"), + EffectivePolicy: intersectBoardPolicies(item.Policy, portalPolicy, placementPolicy)}) + } + err = placements.Err() + _ = placements.Close() + if err != nil { + return nil, err + } + orgSet := map[int]bool{} + for _, item := range items { + for _, id := range item.Policy.OrganisationIDs { + orgSet[id] = true + } + for _, location := range item.Locations { + for _, id := range location.EffectivePolicy.OrganisationIDs { + orgSet[id] = true + } + } + } + orgs := map[int]string{} + orgIDs := make([]int, 0, len(orgSet)) + for id := range orgSet { + orgIDs = append(orgIDs, id) + } + if len(orgIDs) > 0 { + p, a := sqlPlaceholders(orgIDs) + rows, err := s.db.Query(`SELECT id, name FROM customer_organisations WHERE id IN (`+p+`)`, a...) + if err != nil { + return nil, err + } + for rows.Next() { + var id int + var name string + if err := rows.Scan(&id, &name); err != nil { + _ = rows.Close() + return nil, err + } + orgs[id] = name + } + err = rows.Err() + _ = rows.Close() + if err != nil { + return nil, err + } + } + for i := range items { + relevant := slices.Clone(items[i].Policy.OrganisationIDs) + for _, location := range items[i].Locations { + relevant = append(relevant, location.EffectivePolicy.OrganisationIDs...) + } + slices.Sort(relevant) + for _, id := range slices.Compact(relevant) { + if name, found := orgs[id]; found { + items[i].Organizations = append(items[i].Organizations, BoardAudienceOrganisation{ID: id, Name: name}) + } + } + } + // Preserve the page's requested ordering, not the database's IN ordering. + ordered := make([]BoardSharing, 0, len(items)) + for _, id := range ids { + if index, found := byID[id]; found { + ordered = append(ordered, items[index]) + } + } + return ordered, nil +} + +func sqlPlaceholders(ids []int) (placeholders string, args []any) { + args = make([]any, len(ids)) + for i, id := range ids { + if i > 0 { + placeholders += "," + } + placeholders += "?" + args[i] = id + } + return placeholders, args +} diff --git a/internal/services/board_sharing_service.go b/internal/services/board_sharing_service.go new file mode 100644 index 000000000..1d5dee1d9 --- /dev/null +++ b/internal/services/board_sharing_service.go @@ -0,0 +1,415 @@ +package services + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "log/slog" + "slices" + "strings" + "time" + + "windshift/internal/database" + "windshift/internal/logger" + "windshift/internal/models" + "windshift/internal/repository" +) + +type PublicBoardAvailability interface{ PublicBoardsEnabled() bool } + +func (s *CollectionApplicationService) WithSharingNotifications(notifications interface { + CreateNotification(models.Notification) (models.Notification, error) +}) *CollectionApplicationService { + s.sharingNotifications = notifications + return s +} + +func (s *CollectionApplicationService) OwnsBoardCollections(ctx context.Context, userID int) (bool, error) { + var owns bool + err := s.db.QueryRowContext(ctx, `SELECT EXISTS(SELECT 1 FROM collections WHERE created_by = ?)`, userID).Scan(&owns) + return owns, err +} + +type BoardSharing struct { + CollectionID int `json:"collection_id"` + Name string `json:"name"` + OwnerID *int `json:"owner_id"` + OwnerName string `json:"owner_name"` + OwnerActive *bool `json:"owner_active"` + WorkspaceID *int `json:"workspace_id"` + WorkspaceName string `json:"workspace_name"` + Scope string `json:"scope"` + Enabled bool `json:"enabled"` + StandaloneEnabled bool `json:"standalone_enabled"` + Slug *string `json:"slug"` + MilestoneSwimlanes bool `json:"milestone_swimlanes"` + Policy models.CustomerAccessPolicy `json:"policy"` + Revision int `json:"revision"` + RevokedAt *string `json:"revoked_at"` + RevokeReason string `json:"revoke_reason"` + ChangedAt *string `json:"changed_at"` + ChangedBy *int `json:"changed_by"` + ChangedByName string `json:"changed_by_name"` + Organizations []BoardAudienceOrganisation `json:"organisations"` + Locations []BoardPublicationLocation `json:"locations"` + InstanceEnabled bool `json:"instance_enabled"` + CanAdminister bool `json:"can_administer"` +} + +type BoardSharingSave struct { + Revision int `json:"revision"` + Enabled bool `json:"enabled"` + StandaloneEnabled bool `json:"standalone_enabled"` + Slug *string `json:"slug"` + MilestoneSwimlanes bool `json:"milestone_swimlanes"` + Policy models.CustomerAccessPolicy `json:"policy"` +} + +// Audit canonical publication state, not derived location summaries or viewer capabilities. +func boardSharingAuditState(value *BoardSharing) map[string]any { + return map[string]any{"collection_id": value.CollectionID, "scope": value.Scope, "workspace_id": value.WorkspaceID, + "enabled": value.Enabled, "standalone_enabled": value.StandaloneEnabled, "slug": value.Slug, "milestone_swimlanes": value.MilestoneSwimlanes, + "policy": value.Policy, "revision": value.Revision, "revoked_at": value.RevokedAt, "revoke_reason": value.RevokeReason, + "changed_at": value.ChangedAt, "changed_by": value.ChangedBy} +} + +type BoardSharingEvent struct { + ID int `json:"id"` + ActorID *int `json:"actor_id"` + ActorName string `json:"actor_name"` + Action string `json:"action"` + Before json.RawMessage `json:"before"` + After json.RawMessage `json:"after"` + Reason string `json:"reason"` + CreatedAt string `json:"created_at"` +} + +type BoardPublicationFilter struct { + SystemAdminOnly bool + Query string + OwnerID *int + WorkspaceID *int + Global bool + State string + AccessMode string + OrganisationID *int + Limit, Offset int +} + +func (s *CollectionApplicationService) boardsEnabled() (bool, error) { + if s.publicBoards != nil { + return s.publicBoards.PublicBoardsEnabled(), nil + } + value, exists, err := repository.NewSystemSettingRepository(s.db).GetValue("public_boards_enabled") + return !exists || strings.EqualFold(value, "true"), err +} + +func (s *CollectionApplicationService) sharingCollection(userID, id int) (*models.Collection, bool, error) { + collection, err := s.repository.GetModel(id) + if errors.Is(err, repository.ErrNotFound) { + return nil, false, ErrCollectionNotFound + } + if err != nil { + return nil, false, err + } + admin, err := s.permissions.IsSystemAdmin(userID) + if err != nil { + return nil, false, err + } + if !admin && (collection.CreatedBy == nil || *collection.CreatedBy != userID) { + return nil, false, ErrCollectionForbidden + } + return collection, admin, nil +} + +func (s *CollectionApplicationService) GetBoardSharing(userID, id int) (*BoardSharing, error) { + _, admin, err := s.sharingCollection(userID, id) + if err != nil { + return nil, err + } + enabled, err := s.boardsEnabled() + if err != nil { + return nil, err + } + rows, err := s.boardSharingRows([]int{id}, admin, enabled) + if err != nil { + return nil, err + } + if len(rows) == 0 { + return nil, ErrCollectionNotFound + } + return &rows[0], nil +} + +func (s *CollectionApplicationService) SaveBoardSharing(actor AuditActor, id int, input BoardSharingSave) (*BoardSharing, error) { + return s.saveBoardSharing(actor, id, input, logger.ActionCollectionSharingUpdate, "") +} + +func (s *CollectionApplicationService) RevokeBoardSharing(actor AuditActor, id, revision int, reason string, unlock bool) (*BoardSharing, error) { + admin, err := s.permissions.IsSystemAdmin(actor.UserID) + if err != nil { + return nil, err + } + if !admin { + return nil, ErrCollectionForbidden + } + reason = strings.TrimSpace(reason) + if !unlock && (reason == "" || len(reason) > 2000) { + return nil, collectionValidation("a revoke reason of 1-2000 characters is required") + } + current, err := s.GetBoardSharing(actor.UserID, id) + if err != nil { + return nil, err + } + if !unlock && current.RevokedAt != nil && current.RevokeReason == reason { + return current, nil + } + input := BoardSharingSave{Revision: revision, Enabled: false, StandaloneEnabled: current.StandaloneEnabled, Slug: current.Slug, MilestoneSwimlanes: current.MilestoneSwimlanes, Policy: current.Policy} + action := logger.ActionCollectionPublicRevoke + if unlock { + action = logger.ActionCollectionPublicAllowRepublish + } + return s.saveBoardSharing(actor, id, input, action, reason) +} + +func (s *CollectionApplicationService) saveBoardSharing(actor AuditActor, id int, input BoardSharingSave, action, reason string) (*BoardSharing, error) { + collection, _, err := s.sharingCollection(actor.UserID, id) + if err != nil { + return nil, err + } + if input.Revision != collection.SharingRevision { + return nil, ErrCollectionConflict + } + if collection.IsPrivate { + if input.Enabled { + return nil, collectionValidation("make the collection shared before publishing its board") + } + input.Slug = nil + } + if input.Enabled { + enabled, err := s.boardsEnabled() + if err != nil { + return nil, err + } + if !enabled { + return nil, collectionValidation("public boards are disabled on this instance") + } + if collection.PublicRevokedAt != nil { + return nil, collectionValidation("an administrator must allow re-publishing this board") + } + if err := s.validatePublicPermission(actor.UserID, true); err != nil { + return nil, err + } + if err := s.authorizePublicScope(actor.UserID, collection.QLQuery); err != nil { + return nil, err + } + } + if input.Slug != nil { + value := strings.TrimSpace(*input.Slug) + input.Slug = &value + } + if err := s.validateSlug(input.Slug, input.Enabled && input.StandaloneEnabled); err != nil { + return nil, err + } + before, err := s.GetBoardSharing(actor.UserID, id) + if err != nil { + return nil, err + } + if before.Revision != input.Revision { + return nil, ErrCollectionConflict + } + policy := input.Policy + // Removing exposure must still work when a retained audience names a deleted organisation. + // New or changed policies, and every enable, continue to validate against current organisations. + if input.Enabled || policy.Mode != before.Policy.Mode || !slices.Equal(policy.OrganisationIDs, before.Policy.OrganisationIDs) { + policy, err = repository.NewCustomerAccessRepository(s.db).ValidatePolicy(context.Background(), input.Policy) + if err != nil { + if errors.Is(err, repository.ErrCustomerAccessPolicyInvalid) { + return nil, collectionValidation(err.Error()) + } + return nil, err + } + } + input.Policy = policy + if s.beforePublicSharingWrite != nil { + s.beforePublicSharingWrite() + } + now := time.Now().UTC().Format(time.RFC3339Nano) + revokedAt, revokedBy, revokeReason := collection.PublicRevokedAt, collection.PublicRevokedBy, collection.PublicRevokeReason + if action == logger.ActionCollectionPublicRevoke { + revokedAt, revokedBy, revokeReason = &now, &actor.UserID, reason + } + if action == logger.ActionCollectionPublicAllowRepublish { + revokedAt, revokedBy, revokeReason = nil, nil, "" + } + after := *before + after.Enabled, after.StandaloneEnabled, after.Slug = input.Enabled, input.StandaloneEnabled, input.Slug + after.MilestoneSwimlanes, after.Policy, after.Revision = input.MilestoneSwimlanes, input.Policy, input.Revision+1 + after.RevokedAt, after.RevokeReason, after.ChangedAt, after.ChangedBy = revokedAt, revokeReason, &now, &actor.UserID + policyJSON, err := json.Marshal(policy.OrganisationIDs) + if err != nil { + return nil, err + } + err = database.WithTx(s.db, func(tx database.Tx) error { + result, err := tx.Exec(`UPDATE collections SET is_public = ?, board_enabled = ?, board_standalone_enabled = ?, + board_ever_published = board_ever_published OR ?, public_slug = ?, public_milestone_swimlanes = ?, + sharing_revision = sharing_revision + 1, public_revoked_at = ?, public_revoked_by = ?, public_revoke_reason = ?, + sharing_changed_at = ?, sharing_changed_by = ?, updated_at = CURRENT_TIMESTAMP + WHERE id = ? AND sharing_revision = ? AND COALESCE(ql_query, '') = ? AND is_private = ? AND COALESCE(workspace_id, 0) = COALESCE(?, 0)`, + input.Enabled && input.StandaloneEnabled, input.Enabled, input.StandaloneEnabled, input.Enabled, input.Slug, input.MilestoneSwimlanes, + revokedAt, revokedBy, revokeReason, now, actor.UserID, id, input.Revision, collection.QLQuery, collection.IsPrivate, collection.WorkspaceID) + if err != nil { + return err + } + affected, err := result.RowsAffected() + if err != nil { + return err + } + if affected != 1 { + return ErrCollectionConflict + } + if _, err := tx.Exec(`INSERT INTO customer_resource_access (resource_kind, resource_id, mode, organisation_ids) VALUES ('board', ?, ?, ?) + ON CONFLICT(resource_kind, resource_id) DO UPDATE SET mode = excluded.mode, organisation_ids = excluded.organisation_ids`, id, policy.Mode, string(policyJSON)); err != nil { + return err + } + return logger.LogAuditTx(context.Background(), tx, logger.AuditEvent{ + UserID: actor.UserID, Username: actor.Username, IPAddress: actor.IPAddress, UserAgent: actor.UserAgent, + Source: actor.Source, ActionType: action, ResourceType: logger.ResourceCollection, + ResourceID: &id, ResourceName: collection.Name, Success: true, + Details: mergeAuditDetails(map[string]any{"before": boardSharingAuditState(before), "after": boardSharingAuditState(&after), "reason": reason}, actor), + }) + }) + if database.IsUniqueConstraintError(err) { + return nil, ErrCollectionConflict + } + if err != nil { + return nil, err + } + if action == logger.ActionCollectionPublicRevoke && collection.CreatedBy != nil && s.sharingNotifications != nil { + _, notifyErr := s.sharingNotifications.CreateNotification(models.Notification{ + UserID: *collection.CreatedBy, Title: "Board publication revoked", Type: "warning", AuthorizationScope: models.NotificationScopeSystem, + Message: fmt.Sprintf("%s revoked sharing for %s: %s", actor.Username, collection.Name, reason), + ActionURL: fmt.Sprintf("/collections/%d", id), SourceType: "collection.public_revoke", SourceID: &id, + DeliveryKey: fmt.Sprintf("board-revoke:%d:%d", id, after.Revision), + }) + if notifyErr != nil { + slog.Error("board revoke owner notification failed", "collection_id", id, "error", notifyErr) + } + } + return s.GetBoardSharing(actor.UserID, id) +} + +func (s *CollectionApplicationService) BoardSharingHistory(userID, id int) ([]BoardSharingEvent, error) { + if _, _, err := s.sharingCollection(userID, id); err != nil { + return nil, err + } + rows, _, err := repository.NewAuditLogRepository(s.db).List(repository.AuditLogFilters{ + ResourceType: logger.ResourceCollection, ResourceID: &id, + ActionTypes: []string{"collection.sharing_update", "collection.public_revoke", "collection.public_allow_republish", "collection.placement_update", "collection.placement_remove"}, + }, 1, 100) + if err != nil { + return nil, err + } + events := []BoardSharingEvent{} + for _, row := range rows { + before, err := json.Marshal(row.Details["before"]) + if err != nil { + return nil, err + } + after, err := json.Marshal(row.Details["after"]) + if err != nil { + return nil, err + } + reason, _ := row.Details["reason"].(string) + event := BoardSharingEvent{ID: row.ID, ActorID: row.UserID, ActorName: row.Username, Action: row.ActionType, + Before: before, After: after, Reason: reason, CreatedAt: row.Timestamp.UTC().Format(time.RFC3339Nano)} + events = append(events, event) + } + return events, nil +} + +func (s *CollectionApplicationService) ListBoardPublications(userID int, filter BoardPublicationFilter) ([]BoardSharing, int, error) { + admin, err := s.permissions.IsSystemAdmin(userID) + if err != nil { + return nil, 0, err + } + if filter.SystemAdminOnly && !admin { + return nil, 0, ErrCollectionForbidden + } + where := ` WHERE c.board_ever_published = true` + args := []any{} + if !admin { + where += ` AND c.created_by = ?` + args = append(args, userID) + } + if filter.Query != "" { + where += ` AND (LOWER(c.name) LIKE ? OR LOWER(c.public_slug) LIKE ?)` + q := "%" + strings.ToLower(filter.Query) + "%" + args = append(args, q, q) + } + if filter.OwnerID != nil { + where += ` AND c.created_by = ?` + args = append(args, *filter.OwnerID) + } + if filter.WorkspaceID != nil { + where += ` AND c.workspace_id = ?` + args = append(args, *filter.WorkspaceID) + } + if filter.Global { + where += ` AND c.workspace_id IS NULL` + } + switch filter.State { + case "enabled": + where += ` AND c.board_enabled = true` + case "disabled": + where += ` AND c.board_enabled = false` + case "revoked": + where += ` AND c.public_revoked_at IS NOT NULL` + case "", "all": + default: + return nil, 0, collectionValidation("unknown publication state") + } + if filter.AccessMode != "" { + if !slices.Contains([]string{"public", "organisations"}, filter.AccessMode) { + return nil, 0, collectionValidation("unknown access mode") + } + where += ` AND COALESCE(a.mode, 'public') = ?` + args = append(args, filter.AccessMode) + } + if filter.OrganisationID != nil { + // IDs are normalized JSON integers; strip spaces and use comma boundaries. + where += ` AND a.mode = 'organisations' AND (',' || REPLACE(REPLACE(REPLACE(a.organisation_ids, ' ', ''), '[', ''), ']', '') || ',') LIKE ?` + args = append(args, fmt.Sprintf("%%,%d,%%", *filter.OrganisationID)) + } + from := ` FROM collections c LEFT JOIN customer_resource_access a ON a.resource_kind = 'board' AND a.resource_id = c.id` + var total int + if err := s.db.QueryRow(`SELECT COUNT(*)`+from+where, args...).Scan(&total); err != nil { + return nil, 0, err + } + args = append(args, max(1, min(filter.Limit, 1000)), max(0, filter.Offset)) + rows, err := s.db.Query(`SELECT c.id`+from+where+` ORDER BY CASE WHEN c.sharing_changed_at IS NULL THEN 1 ELSE 0 END, c.sharing_changed_at DESC, c.id DESC LIMIT ? OFFSET ?`, args...) + if err != nil { + return nil, 0, err + } + ids := []int{} + for rows.Next() { + var id int + if err := rows.Scan(&id); err != nil { + _ = rows.Close() + return nil, 0, err + } + ids = append(ids, id) + } + err = rows.Err() + _ = rows.Close() + if err != nil { + return nil, 0, err + } + enabled, err := s.boardsEnabled() + if err != nil { + return nil, 0, err + } + result, err := s.boardSharingRows(ids, admin, enabled) + return result, total, err +} diff --git a/internal/services/channel_config_update_service.go b/internal/services/channel_config_update_service.go index 02daf1cf0..07dc97679 100644 --- a/internal/services/channel_config_update_service.go +++ b/internal/services/channel_config_update_service.go @@ -384,7 +384,7 @@ func (s *ChannelConfigUpdateService) preparePublicChannelEnable(ctx context.Cont if slug == "" || !channelSlugPattern.MatchString(slug) { return channelConfigInvalid("A valid public slug is required before enabling this channel") } - if len(workspaceIDs) == 0 { + if len(workspaceIDs) == 0 && (channel.Type != "portal" || config.PortalModuleEnabled("forms")) { return channelConfigInvalid("At least one target workspace is required before enabling this channel") } bad, err := s.channels.repo.FindBadWorkspaceIDs(append([]int(nil), workspaceIDs...)) @@ -405,12 +405,19 @@ func (s *ChannelConfigUpdateService) preparePublicChannelEnable(ctx context.Cont } } } - if err := s.validateRequestTypeRoutes(channel.ID, channel.Type, config); err != nil { - return err + if channel.Type != "portal" || config.PortalModuleEnabled("forms") { + if err := s.validateRequestTypeRoutes(channel.ID, channel.Type, config); err != nil { + return err + } } if channel.Type == "portal" && config.PortalRegistrationMode != "" && config.PortalRegistrationMode != "open" && config.PortalRegistrationMode != "manual" { return channelConfigInvalid("Portal registration mode must be open or manual") } + if channel.Type == "portal" { + if err := validatePortalExperienceSettings(PortalExperienceSettings{Presentation: config.PortalPresentation, Modules: config.PortalModules, Navigation: config.PortalNavigation, DefaultModule: config.PortalDefaultModule}); err != nil { + return channelConfigInvalid(err.Error()) + } + } inUse, err := s.channels.repo.SlugInUse(ctx, channel.Type, slug, channel.ID) if err != nil { return err diff --git a/internal/services/collection_application_service.go b/internal/services/collection_application_service.go index e67765c73..b39a00afa 100644 --- a/internal/services/collection_application_service.go +++ b/internal/services/collection_application_service.go @@ -9,6 +9,7 @@ import ( "regexp" "slices" "strings" + "time" "windshift/internal/database" "windshift/internal/logger" @@ -96,14 +97,18 @@ type BoardConfigurationBootstrap struct { } type CollectionApplicationService struct { - db database.Database - repository *repository.CollectionRepository - permissions *PermissionService - publicScope *PublicBoardScopeService - categories *EnumService - boards *repository.BoardConfigurationRepository - items *ItemCRUDService - workspaces *WorkspaceService + db database.Database + repository *repository.CollectionRepository + permissions *PermissionService + publicScope *PublicBoardScopeService + categories *EnumService + boards *repository.BoardConfigurationRepository + items *ItemCRUDService + workspaces *WorkspaceService + publicBoards PublicBoardAvailability + sharingNotifications interface { + CreateNotification(models.Notification) (models.Notification, error) + } // beforePublicSharingWrite runs between scope authorization and the // conditional write. Tests use it to reproduce a concurrent query edit @@ -111,8 +116,8 @@ type CollectionApplicationService struct { beforePublicSharingWrite func() } -func NewCollectionApplicationService(db database.Database, permissions *PermissionService) *CollectionApplicationService { - return &CollectionApplicationService{ +func NewCollectionApplicationService(db database.Database, permissions *PermissionService, availability ...PublicBoardAvailability) *CollectionApplicationService { + s := &CollectionApplicationService{ db: db, repository: repository.NewCollectionRepository(db), permissions: permissions, publicScope: NewPublicBoardScopeService(db, permissions), categories: NewEnumService(db, NewCollectionCategoryConfig()), @@ -120,6 +125,10 @@ func NewCollectionApplicationService(db database.Database, permissions *Permissi items: NewItemCRUDService(db), workspaces: NewWorkspaceService(db), } + if len(availability) > 0 { + s.publicBoards = availability[0] + } + return s } func (s *CollectionApplicationService) ListCategories() ([]models.CollectionCategory, error) { @@ -277,11 +286,30 @@ func (s *CollectionApplicationService) Create(actor AuditActor, collection model return nil, err } if collection.IsPublic { + if collection.IsPrivate { + return nil, collectionValidation("make the collection shared before publishing its board") + } + enabled, err := s.boardsEnabled() + if err != nil { + return nil, err + } + if !enabled { + return nil, collectionValidation("public boards are disabled on this instance") + } if err := s.authorizePublicScope(actor.UserID, collection.QLQuery); err != nil { return nil, err } } - if err := s.repository.Create(&collection, actor.UserID); err != nil { + var publicationAudit []logger.AuditEvent + if collection.IsPublic { + now := time.Now().UTC().Format(time.RFC3339Nano) + collection.SharingChangedAt, collection.SharingChangedBy = &now, &actor.UserID + publicationAudit = append(publicationAudit, logger.AuditEvent{UserID: actor.UserID, Username: actor.Username, IPAddress: actor.IPAddress, UserAgent: actor.UserAgent, Source: actor.Source, + ActionType: logger.ActionCollectionSharingUpdate, ResourceType: logger.ResourceCollection, ResourceID: &collection.ID, ResourceName: collection.Name, Success: true, + Details: mergeAuditDetails(map[string]any{"before": nil, "after": map[string]any{"collection_id": &collection.ID, "enabled": true, "standalone_enabled": true, "slug": collection.PublicSlug, + "scope": collection.QLQuery, "workspace_id": collection.WorkspaceID, "milestone_swimlanes": collection.PublicMilestoneSwimlanes, "revision": 1, "policy": models.CustomerAccessPolicy{Mode: "public", OrganisationIDs: []int{}}, "changed_at": now, "changed_by": actor.UserID}}, actor)}) + } + if err := s.repository.Create(&collection, actor.UserID, publicationAudit...); err != nil { if database.IsUniqueConstraintError(err) { return nil, ErrCollectionConflict } @@ -291,6 +319,10 @@ func (s *CollectionApplicationService) Create(actor AuditActor, collection model return s.repository.GetModel(collection.ID) } +func optionalCollectionValueEqual[T comparable](left, right *T) bool { + return left == nil && right == nil || left != nil && right != nil && *left == *right +} + func (s *CollectionApplicationService) Update(actor AuditActor, id int, update CollectionUpdate) (*models.Collection, error) { collection, err := s.requireOwner(actor.UserID, id) if err != nil { @@ -300,6 +332,20 @@ func (s *CollectionApplicationService) Update(actor AuditActor, id int, update C return nil, err } oldPublic := collection.IsPublic + oldBoardEnabled := collection.BoardEnabled + sharingChanged := update.IsPublicSet && (update.IsPublic != collection.IsPublic || update.IsPublic != collection.BoardEnabled) || + update.PublicSlugSet && !optionalCollectionValueEqual(update.PublicSlug, collection.PublicSlug) || + update.PublicMilestoneSwimlanesSet && update.PublicMilestoneSwimlanes != collection.PublicMilestoneSwimlanes || + oldBoardEnabled && (update.QLQuerySet && update.QLQuery != collection.QLQuery || + update.WorkspaceIDSet && !optionalCollectionValueEqual(update.WorkspaceID, collection.WorkspaceID) || + update.IsPrivateSet && update.IsPrivate != collection.IsPrivate) + var beforeSharing *BoardSharing + if sharingChanged { + beforeSharing, err = s.GetBoardSharing(actor.UserID, id) + if err != nil { + return nil, err + } + } if update.NameSet { collection.Name = update.Name } @@ -320,6 +366,10 @@ func (s *CollectionApplicationService) Update(actor AuditActor, id int, update C } if update.IsPublicSet { collection.IsPublic = update.IsPublic + collection.BoardEnabled = update.IsPublic + if update.IsPublic { + collection.BoardStandaloneEnabled = true + } } if update.IsPrivateSet { collection.IsPrivate = update.IsPrivate @@ -334,6 +384,7 @@ func (s *CollectionApplicationService) Update(actor AuditActor, id int, update C // stay anonymously readable at its public slug. if collection.IsPrivate { collection.IsPublic = false + collection.BoardEnabled = false collection.PublicSlug = nil } if err := sanitizeCollectionModel(collection); err != nil { @@ -342,7 +393,7 @@ func (s *CollectionApplicationService) Update(actor AuditActor, id int, update C if strings.TrimSpace(collection.Name) == "" { return nil, collectionValidation("name is required") } - publicPolicyChanged := update.IsPublicSet || update.PublicSlugSet || (collection.IsPublic && (update.QLQuerySet || update.WorkspaceIDSet)) + publicPolicyChanged := update.IsPublicSet || update.PublicSlugSet || (collection.BoardEnabled && (update.QLQuerySet || update.WorkspaceIDSet)) if err := s.validatePublicPermission(actor.UserID, publicPolicyChanged); err != nil { return nil, err } @@ -352,13 +403,35 @@ func (s *CollectionApplicationService) Update(actor AuditActor, id int, update C if err := s.validateWorkspaceAndCategory(actor.UserID, collection.WorkspaceID, collection.CategoryID); err != nil { return nil, err } - if collection.IsPublic && (!oldPublic || update.QLQuerySet || update.WorkspaceIDSet) { + if collection.BoardEnabled && (!oldBoardEnabled || !oldPublic && collection.IsPublic || update.IsPublicSet || update.QLQuerySet || update.WorkspaceIDSet) { + enabled, err := s.boardsEnabled() + if err != nil { + return nil, err + } + if !enabled { + return nil, collectionValidation("public boards are disabled on this instance") + } + if collection.PublicRevokedAt != nil { + return nil, collectionValidation("an administrator must allow re-publishing this board") + } if err := s.authorizePublicScope(actor.UserID, collection.QLQuery); err != nil { return nil, err } } - if err := s.repository.Update(id, collection); err != nil { - if database.IsUniqueConstraintError(err) { + var sharingAudit []logger.AuditEvent + if sharingChanged { + now := time.Now().UTC().Format(time.RFC3339Nano) + collection.SharingChangedAt, collection.SharingChangedBy = &now, &actor.UserID + after := *beforeSharing + after.Name, after.Scope, after.WorkspaceID = collection.Name, collection.QLQuery, collection.WorkspaceID + after.Enabled, after.StandaloneEnabled, after.Slug = collection.BoardEnabled, collection.BoardStandaloneEnabled, collection.PublicSlug + after.MilestoneSwimlanes, after.Revision, after.ChangedAt, after.ChangedBy = collection.PublicMilestoneSwimlanes, collection.SharingRevision+1, &now, &actor.UserID + sharingAudit = append(sharingAudit, logger.AuditEvent{UserID: actor.UserID, Username: actor.Username, IPAddress: actor.IPAddress, UserAgent: actor.UserAgent, Source: actor.Source, + ActionType: logger.ActionCollectionSharingUpdate, ResourceType: logger.ResourceCollection, ResourceID: &id, ResourceName: collection.Name, Success: true, + Details: mergeAuditDetails(map[string]any{"before": boardSharingAuditState(beforeSharing), "after": boardSharingAuditState(&after)}, actor)}) + } + if err := s.repository.Update(id, collection, sharingAudit...); err != nil { + if database.IsUniqueConstraintError(err) || errors.Is(err, repository.ErrConflict) { return nil, ErrCollectionConflict } return nil, err @@ -368,58 +441,23 @@ func (s *CollectionApplicationService) Update(actor AuditActor, id int, update C } func (s *CollectionApplicationService) UpdateSharing(actor AuditActor, id int, update CollectionSharingUpdate) (*models.Collection, error) { - collection, err := s.requireOwner(actor.UserID, id) + collection, _, err := s.sharingCollection(actor.UserID, id) if err != nil { return nil, err } - if err := s.requireWorkspaceAccess(actor.UserID, collection); err != nil { - return nil, err - } - // Private always overrides public sharing, so a private collection cannot be - // published. Reject the contradictory request instead of storing an is_public - // flag the public board will never honor, and clear any slug left behind. - if collection.IsPrivate { - if update.IsPublic { - return nil, collectionValidation("make the collection shared before publishing its board") - } - update.PublicSlug = nil - } - if update.PublicSlug != nil { - value := sanitize.ShortIdentifier.Sanitize(*update.PublicSlug) - update.PublicSlug = &value - } - if err := s.validatePublicPermission(actor.UserID, true); err != nil { - return nil, err - } - if err := s.validateSlug(update.PublicSlug, update.IsPublic); err != nil { - return nil, err - } - if update.IsPublic { - if err := s.authorizePublicScope(actor.UserID, collection.QLQuery); err != nil { - return nil, err - } - } - if s.beforePublicSharingWrite != nil { - s.beforePublicSharingWrite() - } publicMilestoneSwimlanes := collection.PublicMilestoneSwimlanes if update.PublicMilestoneSwimlanes != nil { publicMilestoneSwimlanes = *update.PublicMilestoneSwimlanes } - // Publishing is conditional on the authorized scope still being current, so - // a query edit between authorization and this write cannot make an - // unauthorized scope anonymously readable. - updated, err := s.repository.UpdatePublicSharing(id, update.IsPublic, update.PublicSlug, publicMilestoneSwimlanes, collection.QLQuery, collection.WorkspaceID) + policy, err := repository.NewCustomerAccessRepository(s.db).Policy(context.Background(), "board", id) if err != nil { - if database.IsUniqueConstraintError(err) { - return nil, ErrCollectionConflict - } return nil, err } - if !updated { - return nil, fmt.Errorf("%w: collection query changed before it could be published", ErrCollectionConflict) + _, err = s.SaveBoardSharing(actor, id, BoardSharingSave{Revision: collection.SharingRevision, Enabled: update.IsPublic, + StandaloneEnabled: update.IsPublic || collection.BoardStandaloneEnabled, Slug: update.PublicSlug, MilestoneSwimlanes: publicMilestoneSwimlanes, Policy: policy}) + if err != nil { + return nil, err } - emitServiceAudit(s.db, actor, logger.ActionCollectionUpdate, logger.ResourceCollection, &id, collection.Name, nil) return s.repository.GetModel(id) } diff --git a/internal/services/portal_experience_service.go b/internal/services/portal_experience_service.go new file mode 100644 index 000000000..1cd70c0f7 --- /dev/null +++ b/internal/services/portal_experience_service.go @@ -0,0 +1,149 @@ +package services + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "regexp" + "slices" + + "windshift/internal/database" + "windshift/internal/logger" + "windshift/internal/models" + "windshift/internal/repository" +) + +type PortalExperienceSettings struct { + Revision string `json:"revision"` + Presentation string `json:"presentation"` + Modules []string `json:"modules"` + Navigation []string `json:"navigation"` + DefaultModule string `json:"default_module"` +} + +var portalNavigationTarget = regexp.MustCompile(`^(board:[a-zA-Z0-9-]{1,64}|(form|article):[1-9]\d*)$`) + +func validatePortalExperienceSettings(input PortalExperienceSettings) error { + if input.Presentation != "" && input.Presentation != "classic" && input.Presentation != "compact" { + return fmt.Errorf("presentation must be classic or compact") + } + if len(input.Modules) > len(models.PortalModuleKinds) || len(input.Navigation) > 100 || len(input.DefaultModule) > 200 { + return fmt.Errorf("portal navigation configuration is too large") + } + for _, module := range input.Modules { + if !slices.Contains(models.PortalModuleKinds, module) { + return fmt.Errorf("unknown portal module %q", module) + } + } + seen := map[string]bool{} + for _, key := range input.Navigation { + if seen[key] || (!slices.Contains(models.PortalModuleKinds, key) && !portalNavigationTarget.MatchString(key)) { + return fmt.Errorf("invalid or duplicate navigation key %q", key) + } + seen[key] = true + } + if key := input.DefaultModule; key != "" && !slices.Contains(models.PortalModuleKinds, key) && !portalNavigationTarget.MatchString(key) { + return fmt.Errorf("invalid default module %q", key) + } + return nil +} + +func experienceSettings(config string) (PortalExperienceSettings, error) { + var value models.ChannelConfig + if err := json.Unmarshal([]byte(config), &value); err != nil { + return PortalExperienceSettings{}, err + } + digest := sha256.Sum256([]byte(config)) + settings := PortalExperienceSettings{Revision: hex.EncodeToString(digest[:]), Presentation: value.PortalPresentation, Modules: value.PortalModules, Navigation: value.PortalNavigation, DefaultModule: value.PortalDefaultModule} + if settings.Presentation == "" { + settings.Presentation = "classic" + } + return settings, nil +} + +func (s *CollectionApplicationService) GetPortalExperienceSettings(ctx context.Context, userID, channelID int) (*PortalExperienceSettings, error) { + if err := s.requirePortalManager(ctx, userID, channelID); err != nil { + return nil, err + } + raw, err := repository.NewChannelRepository(s.db).GetConfig(ctx, channelID) + if err != nil { + return nil, err + } + settings, err := experienceSettings(raw) + return &settings, err +} + +func (s *CollectionApplicationService) SavePortalExperienceSettings(ctx context.Context, actor AuditActor, channelID int, input PortalExperienceSettings) (*PortalExperienceSettings, error) { + if err := s.requirePortalManager(ctx, actor.UserID, channelID); err != nil { + return nil, err + } + if err := validatePortalExperienceSettings(input); err != nil { + return nil, collectionValidation(err.Error()) + } + channel, err := repository.NewChannelRepository(s.db).FindByID(ctx, channelID) + if err != nil { + return nil, err + } + storedConfig, err := repository.NewChannelRepository(s.db).GetConfig(ctx, channelID) + if err != nil { + return nil, err + } + before, err := experienceSettings(storedConfig) + if err != nil { + return nil, err + } + if input.Revision != before.Revision { + return nil, ErrCollectionConflict + } + var config map[string]json.RawMessage + if err := json.Unmarshal([]byte(storedConfig), &config); err != nil { + return nil, err + } + if config == nil { + config = make(map[string]json.RawMessage) + } + var channelConfig models.ChannelConfig + if err := json.Unmarshal([]byte(storedConfig), &channelConfig); err != nil { + return nil, err + } + if (input.Modules == nil || slices.Contains(input.Modules, "forms")) && len(channelConfig.PortalWorkspaceIDs) == 0 { + return nil, collectionValidation("configure a target workspace before enabling request forms") + } + for key, value := range map[string]any{"portal_presentation": input.Presentation, "portal_modules": input.Modules, "portal_navigation": input.Navigation, "portal_default_module": input.DefaultModule} { + raw, err := json.Marshal(value) + if err != nil { + return nil, err + } + config[key] = raw + } + raw, err := json.Marshal(config) + if err != nil { + return nil, err + } + after, err := experienceSettings(string(raw)) + if err != nil { + return nil, err + } + err = database.WithTx(s.db, func(tx database.Tx) error { + result, err := tx.Exec(`UPDATE channels SET config = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ? AND config = ?`, string(raw), channelID, storedConfig) + if err != nil { + return err + } + count, err := result.RowsAffected() + if err != nil { + return err + } + if count != 1 { + return ErrCollectionConflict + } + return logger.LogAuditTx(ctx, tx, logger.AuditEvent{UserID: actor.UserID, Username: actor.Username, IPAddress: actor.IPAddress, UserAgent: actor.UserAgent, Source: actor.Source, + ActionType: logger.ActionChannelExperienceUpdate, ResourceType: logger.ResourceChannel, ResourceID: &channelID, ResourceName: channel.Name, Success: true, + Details: map[string]any{"before": before, "after": after}}) + }) + if err != nil { + return nil, err + } + return &after, nil +} From 85ddc7e942df0b96b674f664d2324f57c0772260 Mon Sep 17 00:00:00 2001 From: Stefan Ernst <24554551+stefan-ernst@users.noreply.github.com> Date: Mon, 16 Nov 2026 14:05:14 +0100 Subject: [PATCH 2/2] fix: enforce portal admission and preserve approval context (WI-2240) --- .../lib/customer/CompactPortalModule.svelte | 2 ++ .../src/lib/customer/PortalExperience.svelte | 24 +++++++++++++++---- .../src/lib/customer/compactNavigation.js | 5 ++-- internal/handlers/customer_access.go | 11 ++++++++- internal/handlers/portal_boards.go | 6 ++++- internal/handlers/portal_requests.go | 7 +++--- .../restapi/v2/board_contract_metadata.go | 2 +- internal/restapi/v2/contract-metadata.json | 8 +++---- 8 files changed, 48 insertions(+), 17 deletions(-) diff --git a/frontend/src/lib/customer/CompactPortalModule.svelte b/frontend/src/lib/customer/CompactPortalModule.svelte index 62fda9d70..965881e7c 100644 --- a/frontend/src/lib/customer/CompactPortalModule.svelte +++ b/frontend/src/lib/customer/CompactPortalModule.svelte @@ -10,6 +10,7 @@ import Spinner from '../components/Spinner.svelte'; import AlertBox from '../components/AlertBox.svelte'; import PortalLoginModal from '../portal/PortalLoginModal.svelte'; + import GlobalConfirmDialog from '../dialogs/GlobalConfirmDialog.svelte'; let { slug, kind, formId = null, articleId = null, draftsEnabled = true, onidentitychange = null, ondefaultunavailable = null } = $props(); let ready = $state(false); @@ -74,6 +75,7 @@ {/if} {/if} { await onidentitychange?.(); if (!disposed) await load(); }} /> + {#if selectedForm} navigate(`/portal/${slug}?view=requests&id=${id}`), onclose: () => { selectedForm = null; navigate(`/portal/${slug}?module=forms&choose=1`); } }} /> {/if} diff --git a/frontend/src/lib/customer/PortalExperience.svelte b/frontend/src/lib/customer/PortalExperience.svelte index 28a2cff07..e75182409 100644 --- a/frontend/src/lib/customer/PortalExperience.svelte +++ b/frontend/src/lib/customer/PortalExperience.svelte @@ -1,25 +1,41 @@ -{#if error}{:else if !experience}{:else if experience.presentation === 'compact' && !$currentRoute.path.endsWith('/verify')}{:else}{/if} +{#if verifying}{:else if error}{:else if loginStatus} identityRevision++} />{:else if !experience}{:else if experience.presentation === 'compact'}{:else}{/if} diff --git a/frontend/src/lib/customer/compactNavigation.js b/frontend/src/lib/customer/compactNavigation.js index dfc8848e1..3c61f1505 100644 --- a/frontend/src/lib/customer/compactNavigation.js +++ b/frontend/src/lib/customer/compactNavigation.js @@ -39,8 +39,9 @@ export function compactTarget(experience, route, modules) { const query = route.query || {}; if (params.placementId) return { kind: `board:${params.placementId}` }; if (params.pageId) return { kind: 'knowledge-base', articleId: Number(params.pageId) }; - if (route.path.includes('/kb')) return { kind: 'knowledge-base' }; - if (route.path.endsWith('/profile')) return { kind: 'profile' }; + const suffix = route.path.replace(/^\/portal\/[^/]+/, ''); + if (suffix === '/kb') return { kind: 'knowledge-base' }; + if (suffix === '/profile') return { kind: 'profile' }; if (params.requestTypeId) return { kind: 'forms', formId: Number(params.requestTypeId) }; if (query.module || ['requests', 'approvals', 'drafts'].includes(query.view)) return { kind: query.module || query.view }; diff --git a/internal/handlers/customer_access.go b/internal/handlers/customer_access.go index 8845beb97..80ff2ccff 100644 --- a/internal/handlers/customer_access.go +++ b/internal/handlers/customer_access.go @@ -328,6 +328,11 @@ func (h *CustomerAccessHandler) Guard(next http.Handler) http.Handler { switch parts[3] { case "my-requests", "requests": module = "requests" + // Only item context is shared with approvals; the handler still + // requires active approver access when requests are disabled. + if parts[3] == "requests" && len(parts) == 5 && r.Method == http.MethodGet && config.PortalModuleEnabled("approvals") { + module = "" + } case "request-types", "submit", "custom-fields": module = "forms" case "drafts": @@ -431,7 +436,11 @@ func (h *CustomerAccessHandler) issueSession(w http.ResponseWriter, r *http.Requ return nil } -// Check registration rules before a GitHub identity can create a customer. +func portalAdmissionRequired(config models.ChannelConfig) bool { + return config.PortalRegistrationMode != "" && config.PortalRegistrationMode != "open" || len(config.PortalAllowedDomains) > 0 +} + +// Check current registration rules for customer sign-in and portal board reads. func (h *CustomerAccessHandler) portalAdmission(ctx context.Context, surface models.CustomerSurface, email string) error { if surface.Kind != "portal" { return nil diff --git a/internal/handlers/portal_boards.go b/internal/handlers/portal_boards.go index 3ccb6dbb6..17f64e549 100644 --- a/internal/handlers/portal_boards.go +++ b/internal/handlers/portal_boards.go @@ -61,7 +61,7 @@ func (h *CustomerAccessHandler) portalBoard(w http.ResponseWriter, r *http.Reque respondInternalError(w, r, err) return nil, false } - restricted := portalPolicy.Mode != "public" || boardPolicy.Mode != "public" || placement.Policy.Mode != "public" + restricted := portalAdmissionRequired(config) || portalPolicy.Mode != "public" || boardPolicy.Mode != "public" || placement.Policy.Mode != "public" if restricted && id == 0 { respondJSON(w, http.StatusUnauthorized, map[string]any{"error": "Customer sign-in is required", "code": "CUSTOMER_LOGIN_REQUIRED"}) return nil, false @@ -133,6 +133,10 @@ func (h *CustomerAccessHandler) GetPortalExperience(w http.ResponseWriter, r *ht return } id := h.customer(r, *surface) + if id == 0 && portalAdmissionRequired(config) { + respondJSON(w, http.StatusUnauthorized, map[string]any{"error": "Customer sign-in is required", "code": "CUSTOMER_LOGIN_REQUIRED"}) + return + } if id > 0 { _, email, err := h.customers.GetIdentity(r.Context(), id) if err != nil || h.portalAdmission(r.Context(), *surface, email) != nil { diff --git a/internal/handlers/portal_requests.go b/internal/handlers/portal_requests.go index d8e845cad..0c2c04d04 100644 --- a/internal/handlers/portal_requests.go +++ b/internal/handlers/portal_requests.go @@ -35,19 +35,18 @@ func (h *PortalHandler) resolvePortalRequest(w http.ResponseWriter, r *http.Requ // Get auth info from context (middleware already validated) internalUserID, portalCustomerID = h.getAuthFromContext(r) - // Owner branch. + // Ownership grants request access only while the requests module is enabled. isOwner, err := h.portalService.VerifyRequestOwnership(ctx, itemID, channel.ID, internalUserID, portalCustomerID) if err != nil { cancel() respondInternalError(w, r, err) return 0, models.ChannelConfig{}, nil, nil, false, nil, nil, false } - if isOwner { + if isOwner && config.PortalModuleEnabled("requests") { return itemID, config, internalUserID, portalCustomerID, true, ctx, cancel, true } - // Active-approver branch. Only consulted when ownership failed; approvers - // who are also creators have already returned via the owner branch. + // Active approvers may also read item context with requests disabled. // channel.ID is passed in so approver-derived access does not leak across // portal channels (an approver on item X in channel A must not be able to // read X via channel B's portal slug). diff --git a/internal/restapi/v2/board_contract_metadata.go b/internal/restapi/v2/board_contract_metadata.go index 415a583a5..f28dfbe3c 100644 --- a/internal/restapi/v2/board_contract_metadata.go +++ b/internal/restapi/v2/board_contract_metadata.go @@ -36,7 +36,7 @@ func applyBoardContractMetadata(route *Route) { route.Description = summary + ". Management is scoped to the collection owner or portal manager; system administrators retain cross-owner sharing governance. Sharing does not grant source editing or requester privileges. Revision conflicts return 409 without changing stored state." if strings.HasPrefix(route.Path, "/portal/") { route.Tag = "API" - route.Description = summary + ". Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence." + route.Description = summary + ". Customer sessions remain bound to the portal. Admission enforces manual registration and email-domain restrictions, intersecting portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; restricted admission or audience without a portal customer session returns 401, and a signed-in customer outside admission or audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence." } if route.Path == "/admin/board-publications" { route.Description += " Requires system administrator permission; a publishing permission alone does not grant cross-owner inventory access." diff --git a/internal/restapi/v2/contract-metadata.json b/internal/restapi/v2/contract-metadata.json index 50129b79a..535d55896 100644 --- a/internal/restapi/v2/contract-metadata.json +++ b/internal/restapi/v2/contract-metadata.json @@ -9976,7 +9976,7 @@ }, "/portal/{slug}/boards/{placement_id}": { "get": { - "description": "Read a board in its linked portal context. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "description": "Read a board in its linked portal context. Customer sessions remain bound to the portal. Admission enforces manual registration and email-domain restrictions, intersecting portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; restricted admission or audience without a portal customer session returns 401, and a signed-in customer outside admission or audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", "parameters": [ { "Name": "slug", @@ -10014,7 +10014,7 @@ }, "/portal/{slug}/boards/{placement_id}/attachments/{id}/download": { "get": { - "description": "Download a visible image in its portal board context. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "description": "Download a visible image in its portal board context. Customer sessions remain bound to the portal. Admission enforces manual registration and email-domain restrictions, intersecting portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; restricted admission or audience without a portal customer session returns 401, and a signed-in customer outside admission or audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", "parameters": [ { "Name": "id", @@ -10062,7 +10062,7 @@ }, "/portal/{slug}/boards/{placement_id}/items/{key}": { "get": { - "description": "Read externally projected board item detail. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "description": "Read externally projected board item detail. Customer sessions remain bound to the portal. Admission enforces manual registration and email-domain restrictions, intersecting portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; restricted admission or audience without a portal customer session returns 401, and a signed-in customer outside admission or audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", "parameters": [ { "Name": "slug", @@ -10110,7 +10110,7 @@ }, "/portal/{slug}/experience": { "get": { - "description": "Read the policy-filtered customer experience. Customer sessions remain bound to the portal. Admission intersects portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; a restricted audience without a portal customer session returns 401, and a signed-in customer outside the audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", + "description": "Read the policy-filtered customer experience. Customer sessions remain bound to the portal. Admission enforces manual registration and email-domain restrictions, intersecting portal policy, board baseline and placement policy on every request. Missing, disabled, revoked, paused or cross-portal placements are masked with 404; restricted admission or audience without a portal customer session returns 401, and a signed-in customer outside admission or audience returns 403. Responses are private and non-cacheable. Internal sessions are not board audience evidence.", "parameters": [ { "Name": "slug",