From f96861d417101fc80e26bb143bb3ec81d3a710cf Mon Sep 17 00:00:00 2001 From: David Culbreth Date: Tue, 17 Mar 2026 12:17:58 -0500 Subject: [PATCH] properly handling patch updates --- crates/api/src/dto/action.rs | 13 +- crates/api/src/dto/artifact.rs | 34 +- crates/api/src/dto/mod.rs | 2 + crates/api/src/dto/pack.rs | 9 +- crates/api/src/dto/runtime.rs | 181 ++++ crates/api/src/dto/trigger.rs | 29 +- crates/api/src/openapi.rs | 17 + crates/api/src/routes/actions.rs | 9 +- crates/api/src/routes/artifacts.rs | 36 +- crates/api/src/routes/mod.rs | 2 + crates/api/src/routes/packs.rs | 18 +- crates/api/src/routes/runtimes.rs | 303 ++++++ crates/api/src/routes/triggers.rs | 27 +- crates/api/src/server.rs | 1 + crates/cli/src/commands/pack.rs | 11 +- crates/cli/src/commands/trigger.rs | 11 +- crates/common/src/pack_registry/loader.rs | 58 +- crates/common/src/repositories/action.rs | 9 +- crates/common/src/repositories/artifact.rs | 68 +- crates/common/src/repositories/mod.rs | 8 + crates/common/src/repositories/pack.rs | 9 +- crates/common/src/repositories/runtime.rs | 16 +- .../src/repositories/runtime_version.rs | 30 +- crates/common/src/repositories/trigger.rs | 37 +- crates/common/tests/pack_repository_tests.rs | 6 +- .../common/tests/repository_artifact_tests.rs | 10 +- .../common/tests/repository_runtime_tests.rs | 21 +- .../common/tests/sensor_repository_tests.rs | 8 +- .../common/tests/trigger_repository_tests.rs | 8 +- web/src/App.tsx | 4 + web/src/api/core/OpenAPI.ts | 40 +- web/src/api/index.ts | 257 ++--- web/src/api/models/ActionResponse.ts | 121 +-- web/src/api/models/ActionSummary.ts | 91 +- .../api/models/ApiResponse_ActionResponse.ts | 131 +-- .../models/ApiResponse_CurrentUserResponse.ts | 2 +- .../models/ApiResponse_ExecutionResponse.ts | 140 ++- .../api/models/ApiResponse_IdentitySummary.ts | 21 + web/src/api/models/ApiResponse_KeyResponse.ts | 6 +- .../models/ApiResponse_PackInstallResponse.ts | 2 +- ...piResponse_PermissionAssignmentResponse.ts | 21 + .../models/ApiResponse_QueueStatsResponse.ts | 2 +- .../api/models/ApiResponse_RuntimeResponse.ts | 30 + web/src/api/models/ApiResponse_String.ts | 2 +- .../api/models/ApiResponse_TokenResponse.ts | 2 +- .../ApiResponse_WebhookReceiverResponse.ts | 2 +- .../models/ApiResponse_WorkflowResponse.ts | 1 + web/src/api/models/ChangePasswordRequest.ts | 2 +- web/src/api/models/CreateIdentityRequest.ts | 12 + web/src/api/models/CreateKeyRequest.ts | 8 +- .../CreatePermissionAssignmentRequest.ts | 10 + web/src/api/models/CreateRuntimeRequest.ts | 38 + web/src/api/models/CreateWorkflowRequest.ts | 1 + web/src/api/models/CurrentUserResponse.ts | 2 +- web/src/api/models/EnforcementCondition.ts | 2 +- web/src/api/models/EnforcementStatus.ts | 2 +- web/src/api/models/EnforcementSummary.ts | 2 +- web/src/api/models/EventSummary.ts | 2 +- web/src/api/models/ExecutionResponse.ts | 129 ++- web/src/api/models/ExecutionStatus.ts | 2 +- web/src/api/models/ExecutionSummary.ts | 107 +-- web/src/api/models/HealthResponse.ts | 2 +- web/src/api/models/IdentitySummary.ts | 12 + web/src/api/models/InquiryStatus.ts | 2 +- web/src/api/models/InquirySummary.ts | 2 +- web/src/api/models/InstallPackRequest.ts | 2 +- web/src/api/models/KeyResponse.ts | 6 +- web/src/api/models/KeySummary.ts | 2 +- web/src/api/models/LoginRequest.ts | 2 +- web/src/api/models/NullableJsonPatch.ts | 20 + web/src/api/models/NullableStringPatch.ts | 19 + web/src/api/models/OwnerType.ts | 2 +- web/src/api/models/PackInstallResponse.ts | 2 +- web/src/api/models/PackSummary.ts | 2 +- web/src/api/models/PackTestExecution.ts | 2 +- web/src/api/models/PackTestResult.ts | 2 +- web/src/api/models/PackTestSummary.ts | 2 +- .../api/models/PackWorkflowSyncResponse.ts | 2 +- .../models/PackWorkflowValidationResponse.ts | 2 +- .../models/PaginatedResponse_ActionSummary.ts | 103 ++- .../PaginatedResponse_EnforcementSummary.ts | 2 +- .../models/PaginatedResponse_EventSummary.ts | 2 +- .../PaginatedResponse_ExecutionSummary.ts | 120 ++- .../PaginatedResponse_IdentitySummary.ts | 25 + .../PaginatedResponse_InquirySummary.ts | 2 +- .../models/PaginatedResponse_KeySummary.ts | 2 +- .../models/PaginatedResponse_PackSummary.ts | 2 +- .../PaginatedResponse_PackTestSummary.ts | 2 +- .../PaginatedResponse_RuntimeSummary.ts | 27 + .../models/PaginatedResponse_SensorSummary.ts | 2 +- .../PaginatedResponse_TriggerSummary.ts | 2 +- .../PaginatedResponse_WorkflowSummary.ts | 3 +- web/src/api/models/PaginationMeta.ts | 2 +- .../models/PermissionAssignmentResponse.ts | 12 + web/src/api/models/PermissionSetSummary.ts | 14 + web/src/api/models/QueueStatsResponse.ts | 2 +- web/src/api/models/RefreshTokenRequest.ts | 2 +- web/src/api/models/RegisterPackRequest.ts | 2 +- web/src/api/models/RegisterRequest.ts | 2 +- web/src/api/models/RuntimeResponse.ts | 21 + web/src/api/models/RuntimeSummary.ts | 17 + web/src/api/models/SensorSummary.ts | 2 +- web/src/api/models/SuccessResponse.ts | 2 +- web/src/api/models/TestCaseResult.ts | 2 +- web/src/api/models/TestStatus.ts | 2 +- web/src/api/models/TestSuiteResult.ts | 2 +- web/src/api/models/TokenResponse.ts | 2 +- web/src/api/models/TriggerSummary.ts | 2 +- web/src/api/models/UpdateIdentityRequest.ts | 11 + web/src/api/models/UpdateKeyRequest.ts | 6 +- web/src/api/models/UpdateRuntimeRequest.ts | 26 + web/src/api/models/UpdateWorkflowRequest.ts | 1 + web/src/api/models/UserInfo.ts | 2 +- web/src/api/models/WebhookReceiverRequest.ts | 2 +- web/src/api/models/WebhookReceiverResponse.ts | 2 +- web/src/api/models/WorkflowResponse.ts | 1 + web/src/api/models/WorkflowSummary.ts | 3 +- web/src/api/models/WorkflowSyncResult.ts | 2 +- web/src/api/models/i64.ts | 2 +- web/src/api/services/ActionsService.ts | 874 +++++++++--------- web/src/api/services/AuthService.ts | 2 +- web/src/api/services/EnforcementsService.ts | 8 +- web/src/api/services/EventsService.ts | 2 +- web/src/api/services/ExecutionsService.ts | 542 ++++++----- web/src/api/services/InquiriesService.ts | 2 +- web/src/api/services/PermissionsService.ts | 298 ++++++ web/src/api/services/RulesService.ts | 2 +- web/src/api/services/RuntimesService.ts | 172 ++++ web/src/api/services/SecretsService.ts | 14 +- web/src/api/services/SensorsService.ts | 2 +- web/src/api/services/TriggersService.ts | 2 +- web/src/api/services/WebhooksService.ts | 2 +- web/src/components/forms/RuntimeForm.tsx | 347 +++++++ web/src/components/layout/MainLayout.tsx | 7 + web/src/hooks/useRuntimes.ts | 64 ++ web/src/pages/runtimes/RuntimesPage.tsx | 285 ++++++ 136 files changed, 3782 insertions(+), 1553 deletions(-) create mode 100644 crates/api/src/dto/runtime.rs create mode 100644 crates/api/src/routes/runtimes.rs create mode 100644 web/src/api/models/ApiResponse_IdentitySummary.ts create mode 100644 web/src/api/models/ApiResponse_PermissionAssignmentResponse.ts create mode 100644 web/src/api/models/ApiResponse_RuntimeResponse.ts create mode 100644 web/src/api/models/CreateIdentityRequest.ts create mode 100644 web/src/api/models/CreatePermissionAssignmentRequest.ts create mode 100644 web/src/api/models/CreateRuntimeRequest.ts create mode 100644 web/src/api/models/IdentitySummary.ts create mode 100644 web/src/api/models/NullableJsonPatch.ts create mode 100644 web/src/api/models/NullableStringPatch.ts create mode 100644 web/src/api/models/PaginatedResponse_IdentitySummary.ts create mode 100644 web/src/api/models/PaginatedResponse_RuntimeSummary.ts create mode 100644 web/src/api/models/PermissionAssignmentResponse.ts create mode 100644 web/src/api/models/PermissionSetSummary.ts create mode 100644 web/src/api/models/RuntimeResponse.ts create mode 100644 web/src/api/models/RuntimeSummary.ts create mode 100644 web/src/api/models/UpdateIdentityRequest.ts create mode 100644 web/src/api/models/UpdateRuntimeRequest.ts create mode 100644 web/src/api/services/PermissionsService.ts create mode 100644 web/src/api/services/RuntimesService.ts create mode 100644 web/src/components/forms/RuntimeForm.tsx create mode 100644 web/src/hooks/useRuntimes.ts create mode 100644 web/src/pages/runtimes/RuntimesPage.tsx diff --git a/crates/api/src/dto/action.rs b/crates/api/src/dto/action.rs index e8a21fa..1f23a45 100644 --- a/crates/api/src/dto/action.rs +++ b/crates/api/src/dto/action.rs @@ -76,9 +76,8 @@ pub struct UpdateActionRequest { #[schema(example = 1)] pub runtime: Option, - /// Optional semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") - #[schema(example = ">=3.12", nullable = true)] - pub runtime_version_constraint: Option>, + /// Optional semver version constraint patch for the runtime. + pub runtime_version_constraint: Option, /// Parameter schema (StackStorm-style with inline required/secret) #[schema(value_type = Object, nullable = true)] @@ -89,6 +88,14 @@ pub struct UpdateActionRequest { pub out_schema: Option, } +/// Explicit patch operation for a nullable runtime version constraint. +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum RuntimeVersionConstraintPatch { + Set(String), + Clear, +} + /// Response DTO for action information #[derive(Debug, Clone, Serialize, ToSchema)] pub struct ActionResponse { diff --git a/crates/api/src/dto/artifact.rs b/crates/api/src/dto/artifact.rs index 1dda60b..9b89e85 100644 --- a/crates/api/src/dto/artifact.rs +++ b/crates/api/src/dto/artifact.rs @@ -97,19 +97,41 @@ pub struct UpdateArtifactRequest { pub retention_limit: Option, /// Updated name - pub name: Option, + pub name: Option, /// Updated description - pub description: Option, + pub description: Option, /// Updated content type - pub content_type: Option, + pub content_type: Option, - /// Updated execution ID (re-links artifact to a different execution) - pub execution: Option, + /// Updated execution patch (set a new execution ID or clear the link) + pub execution: Option, /// Updated structured data (replaces existing data entirely) - pub data: Option, + pub data: Option, +} + +/// Explicit patch operation for a nullable execution link. +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum ArtifactExecutionPatch { + Set(i64), + Clear, +} + +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum ArtifactStringPatch { + Set(String), + Clear, +} + +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum ArtifactJsonPatch { + Set(JsonValue), + Clear, } /// Request DTO for appending to a progress-type artifact diff --git a/crates/api/src/dto/mod.rs b/crates/api/src/dto/mod.rs index 3d19b5f..cbab859 100644 --- a/crates/api/src/dto/mod.rs +++ b/crates/api/src/dto/mod.rs @@ -13,6 +13,7 @@ pub mod key; pub mod pack; pub mod permission; pub mod rule; +pub mod runtime; pub mod trigger; pub mod webhook; pub mod workflow; @@ -55,6 +56,7 @@ pub use permission::{ UpdateIdentityRequest, }; pub use rule::{CreateRuleRequest, RuleResponse, RuleSummary, UpdateRuleRequest}; +pub use runtime::{CreateRuntimeRequest, RuntimeResponse, RuntimeSummary, UpdateRuntimeRequest}; pub use trigger::{ CreateSensorRequest, CreateTriggerRequest, SensorResponse, SensorSummary, TriggerResponse, TriggerSummary, UpdateSensorRequest, UpdateTriggerRequest, diff --git a/crates/api/src/dto/pack.rs b/crates/api/src/dto/pack.rs index a4c1024..857e4ce 100644 --- a/crates/api/src/dto/pack.rs +++ b/crates/api/src/dto/pack.rs @@ -129,7 +129,7 @@ pub struct UpdatePackRequest { /// Pack description #[schema(example = "Enhanced Slack integration with new features")] - pub description: Option, + pub description: Option, /// Pack version #[validate(length(min = 1, max = 50))] @@ -165,6 +165,13 @@ pub struct UpdatePackRequest { pub is_standard: Option, } +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum PackDescriptionPatch { + Set(String), + Clear, +} + /// Response DTO for pack information #[derive(Debug, Clone, Serialize, ToSchema)] pub struct PackResponse { diff --git a/crates/api/src/dto/runtime.rs b/crates/api/src/dto/runtime.rs new file mode 100644 index 0000000..cce787a --- /dev/null +++ b/crates/api/src/dto/runtime.rs @@ -0,0 +1,181 @@ +//! Runtime DTOs for API requests and responses + +use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; +use serde_json::Value as JsonValue; +use utoipa::ToSchema; +use validator::Validate; + +/// Request DTO for creating a runtime. +#[derive(Debug, Clone, Deserialize, Validate, ToSchema)] +pub struct CreateRuntimeRequest { + /// Unique reference identifier (e.g. "core.python", "core.nodejs") + #[validate(length(min = 1, max = 255))] + #[schema(example = "core.python")] + pub r#ref: String, + + /// Optional pack reference this runtime belongs to + #[validate(length(min = 1, max = 255))] + #[schema(example = "core", nullable = true)] + pub pack_ref: Option, + + /// Optional human-readable description + #[validate(length(min = 1))] + #[schema(example = "Python runtime with virtualenv support", nullable = true)] + pub description: Option, + + /// Display name + #[validate(length(min = 1, max = 255))] + #[schema(example = "Python")] + pub name: String, + + /// Distribution metadata used for verification and platform support + #[serde(default)] + #[schema(value_type = Object, example = json!({"linux": {"supported": true}}))] + pub distributions: JsonValue, + + /// Optional installation metadata + #[serde(skip_serializing_if = "Option::is_none")] + #[schema(value_type = Object, nullable = true, example = json!({"method": "system"}))] + pub installation: Option, + + /// Runtime execution configuration + #[serde(default)] + #[schema(value_type = Object, example = json!({"interpreter": {"command": "python3"}}))] + pub execution_config: JsonValue, +} + +/// Request DTO for updating a runtime. +#[derive(Debug, Clone, Deserialize, Validate, ToSchema)] +pub struct UpdateRuntimeRequest { + /// Optional human-readable description patch. + pub description: Option, + + /// Display name + #[validate(length(min = 1, max = 255))] + #[schema(example = "Python 3")] + pub name: Option, + + /// Distribution metadata used for verification and platform support + #[schema(value_type = Object, nullable = true)] + pub distributions: Option, + + /// Optional installation metadata patch. + pub installation: Option, + + /// Runtime execution configuration + #[schema(value_type = Object, nullable = true)] + pub execution_config: Option, +} + +/// Explicit patch operation for nullable string fields. +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum NullableStringPatch { + #[schema(title = "SetString")] + Set(String), + Clear, +} + +/// Explicit patch operation for nullable JSON fields. +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum NullableJsonPatch { + #[schema(title = "SetJson")] + Set(JsonValue), + Clear, +} + +/// Full runtime response. +#[derive(Debug, Clone, Serialize, ToSchema)] +pub struct RuntimeResponse { + #[schema(example = 1)] + pub id: i64, + + #[schema(example = "core.python")] + pub r#ref: String, + + #[schema(example = 1, nullable = true)] + pub pack: Option, + + #[schema(example = "core", nullable = true)] + pub pack_ref: Option, + + #[schema(example = "Python runtime with virtualenv support", nullable = true)] + pub description: Option, + + #[schema(example = "Python")] + pub name: String, + + #[schema(value_type = Object)] + pub distributions: JsonValue, + + #[schema(value_type = Object, nullable = true)] + pub installation: Option, + + #[schema(value_type = Object)] + pub execution_config: JsonValue, + + #[schema(example = "2024-01-13T10:30:00Z")] + pub created: DateTime, + + #[schema(example = "2024-01-13T10:30:00Z")] + pub updated: DateTime, +} + +/// Runtime summary for list views. +#[derive(Debug, Clone, Serialize, ToSchema)] +pub struct RuntimeSummary { + #[schema(example = 1)] + pub id: i64, + + #[schema(example = "core.python")] + pub r#ref: String, + + #[schema(example = "core", nullable = true)] + pub pack_ref: Option, + + #[schema(example = "Python runtime with virtualenv support", nullable = true)] + pub description: Option, + + #[schema(example = "Python")] + pub name: String, + + #[schema(example = "2024-01-13T10:30:00Z")] + pub created: DateTime, + + #[schema(example = "2024-01-13T10:30:00Z")] + pub updated: DateTime, +} + +impl From for RuntimeResponse { + fn from(runtime: attune_common::models::runtime::Runtime) -> Self { + Self { + id: runtime.id, + r#ref: runtime.r#ref, + pack: runtime.pack, + pack_ref: runtime.pack_ref, + description: runtime.description, + name: runtime.name, + distributions: runtime.distributions, + installation: runtime.installation, + execution_config: runtime.execution_config, + created: runtime.created, + updated: runtime.updated, + } + } +} + +impl From for RuntimeSummary { + fn from(runtime: attune_common::models::runtime::Runtime) -> Self { + Self { + id: runtime.id, + r#ref: runtime.r#ref, + pack_ref: runtime.pack_ref, + description: runtime.description, + name: runtime.name, + created: runtime.created, + updated: runtime.updated, + } + } +} diff --git a/crates/api/src/dto/trigger.rs b/crates/api/src/dto/trigger.rs index 1a9e5d0..4653703 100644 --- a/crates/api/src/dto/trigger.rs +++ b/crates/api/src/dto/trigger.rs @@ -54,21 +54,35 @@ pub struct UpdateTriggerRequest { /// Trigger description #[schema(example = "Updated webhook trigger description")] - pub description: Option, + pub description: Option, /// Parameter schema (StackStorm-style with inline required/secret) #[schema(value_type = Object, nullable = true)] - pub param_schema: Option, + pub param_schema: Option, /// Output schema #[schema(value_type = Object, nullable = true)] - pub out_schema: Option, + pub out_schema: Option, /// Whether the trigger is enabled #[schema(example = true)] pub enabled: Option, } +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum TriggerStringPatch { + Set(String), + Clear, +} + +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum TriggerJsonPatch { + Set(JsonValue), + Clear, +} + /// Response DTO for trigger information #[derive(Debug, Clone, Serialize, ToSchema)] pub struct TriggerResponse { @@ -244,13 +258,20 @@ pub struct UpdateSensorRequest { /// Parameter schema (StackStorm-style with inline required/secret) #[schema(value_type = Object, nullable = true)] - pub param_schema: Option, + pub param_schema: Option, /// Whether the sensor is enabled #[schema(example = false)] pub enabled: Option, } +#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)] +#[serde(tag = "op", content = "value", rename_all = "snake_case")] +pub enum SensorJsonPatch { + Set(JsonValue), + Clear, +} + /// Response DTO for sensor information #[derive(Debug, Clone, Serialize, ToSchema)] pub struct SensorResponse { diff --git a/crates/api/src/openapi.rs b/crates/api/src/openapi.rs index 57db570..e269066 100644 --- a/crates/api/src/openapi.rs +++ b/crates/api/src/openapi.rs @@ -31,6 +31,7 @@ use crate::dto::{ IdentitySummary, PermissionAssignmentResponse, PermissionSetSummary, UpdateIdentityRequest, }, rule::{CreateRuleRequest, RuleResponse, RuleSummary, UpdateRuleRequest}, + runtime::{CreateRuntimeRequest, RuntimeResponse, RuntimeSummary, UpdateRuntimeRequest}, trigger::{ CreateSensorRequest, CreateTriggerRequest, SensorResponse, SensorSummary, TriggerResponse, TriggerSummary, UpdateSensorRequest, UpdateTriggerRequest, @@ -96,6 +97,14 @@ use crate::dto::{ crate::routes::actions::delete_action, crate::routes::actions::get_queue_stats, + // Runtimes + crate::routes::runtimes::list_runtimes, + crate::routes::runtimes::list_runtimes_by_pack, + crate::routes::runtimes::get_runtime, + crate::routes::runtimes::create_runtime, + crate::routes::runtimes::update_runtime, + crate::routes::runtimes::delete_runtime, + // Triggers crate::routes::triggers::list_triggers, crate::routes::triggers::list_enabled_triggers, @@ -197,6 +206,7 @@ use crate::dto::{ ApiResponse, ApiResponse, ApiResponse, + ApiResponse, ApiResponse, ApiResponse, ApiResponse, @@ -211,6 +221,7 @@ use crate::dto::{ ApiResponse, PaginatedResponse, PaginatedResponse, + PaginatedResponse, PaginatedResponse, PaginatedResponse, PaginatedResponse, @@ -258,6 +269,12 @@ use crate::dto::{ PermissionSetSummary, PermissionAssignmentResponse, CreatePermissionAssignmentRequest, + + // Runtime DTOs + CreateRuntimeRequest, + UpdateRuntimeRequest, + RuntimeResponse, + RuntimeSummary, IdentitySummary, // Action DTOs diff --git a/crates/api/src/routes/actions.rs b/crates/api/src/routes/actions.rs index 497242a..03a1564 100644 --- a/crates/api/src/routes/actions.rs +++ b/crates/api/src/routes/actions.rs @@ -15,7 +15,7 @@ use attune_common::repositories::{ action::{ActionRepository, ActionSearchFilters, CreateActionInput, UpdateActionInput}, pack::PackRepository, queue_stats::QueueStatsRepository, - Create, Delete, FindByRef, Update, + Create, Delete, FindByRef, Patch, Update, }; use crate::{ @@ -24,7 +24,7 @@ use crate::{ dto::{ action::{ ActionResponse, ActionSummary, CreateActionRequest, QueueStatsResponse, - UpdateActionRequest, + RuntimeVersionConstraintPatch, UpdateActionRequest, }, common::{PaginatedResponse, PaginationParams}, ApiResponse, SuccessResponse, @@ -280,7 +280,10 @@ pub async fn update_action( description: request.description, entrypoint: request.entrypoint, runtime: request.runtime, - runtime_version_constraint: request.runtime_version_constraint, + runtime_version_constraint: request.runtime_version_constraint.map(|patch| match patch { + RuntimeVersionConstraintPatch::Set(value) => Patch::Set(value), + RuntimeVersionConstraintPatch::Clear => Patch::Clear, + }), param_schema: request.param_schema, out_schema: request.out_schema, parameter_delivery: None, diff --git a/crates/api/src/routes/artifacts.rs b/crates/api/src/routes/artifacts.rs index 5424186..06c59ed 100644 --- a/crates/api/src/routes/artifacts.rs +++ b/crates/api/src/routes/artifacts.rs @@ -36,15 +36,16 @@ use attune_common::repositories::{ ArtifactRepository, ArtifactSearchFilters, ArtifactVersionRepository, CreateArtifactInput, CreateArtifactVersionInput, UpdateArtifactInput, }, - Create, Delete, FindById, FindByRef, Update, + Create, Delete, FindById, FindByRef, Patch, Update, }; use crate::{ auth::middleware::RequireAuth, dto::{ artifact::{ - AllocateFileVersionByRefRequest, AppendProgressRequest, ArtifactQueryParams, - ArtifactResponse, ArtifactSummary, ArtifactVersionResponse, ArtifactVersionSummary, + AllocateFileVersionByRefRequest, AppendProgressRequest, ArtifactExecutionPatch, + ArtifactJsonPatch, ArtifactQueryParams, ArtifactResponse, ArtifactStringPatch, + ArtifactSummary, ArtifactVersionResponse, ArtifactVersionSummary, CreateArtifactRequest, CreateFileVersionRequest, CreateVersionJsonRequest, SetDataRequest, UpdateArtifactRequest, }, @@ -257,12 +258,27 @@ pub async fn update_artifact( visibility: request.visibility, retention_policy: request.retention_policy, retention_limit: request.retention_limit, - name: request.name, - description: request.description, - content_type: request.content_type, + name: request.name.map(|patch| match patch { + ArtifactStringPatch::Set(value) => Patch::Set(value), + ArtifactStringPatch::Clear => Patch::Clear, + }), + description: request.description.map(|patch| match patch { + ArtifactStringPatch::Set(value) => Patch::Set(value), + ArtifactStringPatch::Clear => Patch::Clear, + }), + content_type: request.content_type.map(|patch| match patch { + ArtifactStringPatch::Set(value) => Patch::Set(value), + ArtifactStringPatch::Clear => Patch::Clear, + }), size_bytes: None, // Managed by version creation trigger - execution: request.execution.map(Some), - data: request.data, + execution: request.execution.map(|patch| match patch { + ArtifactExecutionPatch::Set(value) => Patch::Set(value), + ArtifactExecutionPatch::Clear => Patch::Clear, + }), + data: request.data.map(|patch| match patch { + ArtifactJsonPatch::Set(value) => Patch::Set(value), + ArtifactJsonPatch::Clear => Patch::Clear, + }), }; let updated = ArtifactRepository::update(&state.db, id, input).await?; @@ -1155,7 +1171,7 @@ pub async fn upload_version_by_ref( description: None, content_type: None, size_bytes: None, - execution: execution_id.map(Some), + execution: execution_id.map(Patch::Set), data: None, }; ArtifactRepository::update(&state.db, existing.id, update_input).await? @@ -1303,7 +1319,7 @@ pub async fn allocate_file_version_by_ref( description: None, content_type: None, size_bytes: None, - execution: request.execution.map(Some), + execution: request.execution.map(Patch::Set), data: None, }; ArtifactRepository::update(&state.db, existing.id, update_input).await? diff --git a/crates/api/src/routes/mod.rs b/crates/api/src/routes/mod.rs index 459f33d..33a0e5b 100644 --- a/crates/api/src/routes/mod.rs +++ b/crates/api/src/routes/mod.rs @@ -13,6 +13,7 @@ pub mod keys; pub mod packs; pub mod permissions; pub mod rules; +pub mod runtimes; pub mod triggers; pub mod webhooks; pub mod workflows; @@ -30,6 +31,7 @@ pub use keys::routes as key_routes; pub use packs::routes as pack_routes; pub use permissions::routes as permission_routes; pub use rules::routes as rule_routes; +pub use runtimes::routes as runtime_routes; pub use triggers::routes as trigger_routes; pub use webhooks::routes as webhook_routes; pub use workflows::routes as workflow_routes; diff --git a/crates/api/src/routes/packs.rs b/crates/api/src/routes/packs.rs index 55fce10..c5f74cc 100644 --- a/crates/api/src/routes/packs.rs +++ b/crates/api/src/routes/packs.rs @@ -16,7 +16,8 @@ use attune_common::mq::{MessageEnvelope, MessageType, PackRegisteredPayload}; use attune_common::rbac::{Action, AuthorizationContext, Resource}; use attune_common::repositories::{ pack::{CreatePackInput, UpdatePackInput}, - Create, Delete, FindById, FindByRef, PackRepository, PackTestRepository, Pagination, Update, + Create, Delete, FindById, FindByRef, PackRepository, PackTestRepository, Pagination, Patch, + Update, }; use attune_common::workflow::{PackWorkflowService, PackWorkflowServiceConfig}; @@ -29,8 +30,9 @@ use crate::{ BuildPackEnvsRequest, BuildPackEnvsResponse, CreatePackRequest, DownloadPacksRequest, DownloadPacksResponse, GetPackDependenciesRequest, GetPackDependenciesResponse, InstallPackRequest, PackInstallResponse, PackResponse, PackSummary, - PackWorkflowSyncResponse, PackWorkflowValidationResponse, RegisterPackRequest, - RegisterPacksRequest, RegisterPacksResponse, UpdatePackRequest, WorkflowSyncResult, + PackDescriptionPatch, PackWorkflowSyncResponse, PackWorkflowValidationResponse, + RegisterPackRequest, RegisterPacksRequest, RegisterPacksResponse, UpdatePackRequest, + WorkflowSyncResult, }, ApiResponse, SuccessResponse, }, @@ -258,7 +260,10 @@ pub async fn update_pack( // Create update input let update_input = UpdatePackInput { label: request.label, - description: request.description, + description: request.description.map(|patch| match patch { + PackDescriptionPatch::Set(value) => Patch::Set(value), + PackDescriptionPatch::Clear => Patch::Clear, + }), version: request.version, conf_schema: request.conf_schema, config: request.config, @@ -876,7 +881,10 @@ async fn register_pack_internal( // Update existing pack in place — preserves pack ID and all child entity IDs let update_input = UpdatePackInput { label: Some(label), - description: Some(description.unwrap_or_default()), + description: Some(match description { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), version: Some(version.clone()), conf_schema: Some(conf_schema), config: None, // preserve user-set config diff --git a/crates/api/src/routes/runtimes.rs b/crates/api/src/routes/runtimes.rs new file mode 100644 index 0000000..3bffd12 --- /dev/null +++ b/crates/api/src/routes/runtimes.rs @@ -0,0 +1,303 @@ +//! Runtime management API routes + +use axum::{ + extract::{Path, Query, State}, + http::StatusCode, + response::IntoResponse, + routing::get, + Json, Router, +}; +use std::sync::Arc; +use validator::Validate; + +use attune_common::repositories::{ + pack::PackRepository, + runtime::{CreateRuntimeInput, RuntimeRepository, UpdateRuntimeInput}, + Create, Delete, FindByRef, List, Patch, Update, +}; + +use crate::{ + auth::middleware::RequireAuth, + dto::{ + common::{PaginatedResponse, PaginationParams}, + runtime::{ + CreateRuntimeRequest, NullableJsonPatch, NullableStringPatch, RuntimeResponse, + RuntimeSummary, UpdateRuntimeRequest, + }, + ApiResponse, SuccessResponse, + }, + middleware::{ApiError, ApiResult}, + state::AppState, +}; + +#[utoipa::path( + get, + path = "/api/v1/runtimes", + tag = "runtimes", + params(PaginationParams), + responses( + (status = 200, description = "List of runtimes", body = PaginatedResponse) + ), + security(("bearer_auth" = [])) +)] +pub async fn list_runtimes( + State(state): State>, + RequireAuth(_user): RequireAuth, + Query(pagination): Query, +) -> ApiResult { + let all_runtimes = RuntimeRepository::list(&state.db).await?; + let total = all_runtimes.len() as u64; + let rows: Vec<_> = all_runtimes + .into_iter() + .skip(pagination.offset() as usize) + .take(pagination.limit() as usize) + .collect(); + + let response = PaginatedResponse::new( + rows.into_iter().map(RuntimeSummary::from).collect(), + &pagination, + total, + ); + + Ok((StatusCode::OK, Json(response))) +} + +#[utoipa::path( + get, + path = "/api/v1/packs/{pack_ref}/runtimes", + tag = "runtimes", + params( + ("pack_ref" = String, Path, description = "Pack reference identifier"), + PaginationParams + ), + responses( + (status = 200, description = "List of runtimes for a pack", body = PaginatedResponse), + (status = 404, description = "Pack not found") + ), + security(("bearer_auth" = [])) +)] +pub async fn list_runtimes_by_pack( + State(state): State>, + RequireAuth(_user): RequireAuth, + Path(pack_ref): Path, + Query(pagination): Query, +) -> ApiResult { + let pack = PackRepository::find_by_ref(&state.db, &pack_ref) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Pack '{}' not found", pack_ref)))?; + + let all_runtimes = RuntimeRepository::find_by_pack(&state.db, pack.id).await?; + let total = all_runtimes.len() as u64; + let rows: Vec<_> = all_runtimes + .into_iter() + .skip(pagination.offset() as usize) + .take(pagination.limit() as usize) + .collect(); + + let response = PaginatedResponse::new( + rows.into_iter().map(RuntimeSummary::from).collect(), + &pagination, + total, + ); + + Ok((StatusCode::OK, Json(response))) +} + +#[utoipa::path( + get, + path = "/api/v1/runtimes/{ref}", + tag = "runtimes", + params(("ref" = String, Path, description = "Runtime reference identifier")), + responses( + (status = 200, description = "Runtime details", body = ApiResponse), + (status = 404, description = "Runtime not found") + ), + security(("bearer_auth" = [])) +)] +pub async fn get_runtime( + State(state): State>, + RequireAuth(_user): RequireAuth, + Path(runtime_ref): Path, +) -> ApiResult { + let runtime = RuntimeRepository::find_by_ref(&state.db, &runtime_ref) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Runtime '{}' not found", runtime_ref)))?; + + Ok(( + StatusCode::OK, + Json(ApiResponse::new(RuntimeResponse::from(runtime))), + )) +} + +#[utoipa::path( + post, + path = "/api/v1/runtimes", + tag = "runtimes", + request_body = CreateRuntimeRequest, + responses( + (status = 201, description = "Runtime created successfully", body = ApiResponse), + (status = 400, description = "Validation error"), + (status = 404, description = "Pack not found"), + (status = 409, description = "Runtime with same ref already exists") + ), + security(("bearer_auth" = [])) +)] +pub async fn create_runtime( + State(state): State>, + RequireAuth(_user): RequireAuth, + Json(request): Json, +) -> ApiResult { + request.validate()?; + + if RuntimeRepository::find_by_ref(&state.db, &request.r#ref) + .await? + .is_some() + { + return Err(ApiError::Conflict(format!( + "Runtime with ref '{}' already exists", + request.r#ref + ))); + } + + let (pack_id, pack_ref) = if let Some(ref pack_ref_str) = request.pack_ref { + let pack = PackRepository::find_by_ref(&state.db, pack_ref_str) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Pack '{}' not found", pack_ref_str)))?; + (Some(pack.id), Some(pack.r#ref)) + } else { + (None, None) + }; + + let runtime = RuntimeRepository::create( + &state.db, + CreateRuntimeInput { + r#ref: request.r#ref, + pack: pack_id, + pack_ref, + description: request.description, + name: request.name, + distributions: request.distributions, + installation: request.installation, + execution_config: request.execution_config, + }, + ) + .await?; + + Ok(( + StatusCode::CREATED, + Json(ApiResponse::with_message( + RuntimeResponse::from(runtime), + "Runtime created successfully", + )), + )) +} + +#[utoipa::path( + put, + path = "/api/v1/runtimes/{ref}", + tag = "runtimes", + params(("ref" = String, Path, description = "Runtime reference identifier")), + request_body = UpdateRuntimeRequest, + responses( + (status = 200, description = "Runtime updated successfully", body = ApiResponse), + (status = 400, description = "Validation error"), + (status = 404, description = "Runtime not found") + ), + security(("bearer_auth" = [])) +)] +pub async fn update_runtime( + State(state): State>, + RequireAuth(_user): RequireAuth, + Path(runtime_ref): Path, + Json(request): Json, +) -> ApiResult { + request.validate()?; + + let existing_runtime = RuntimeRepository::find_by_ref(&state.db, &runtime_ref) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Runtime '{}' not found", runtime_ref)))?; + + let runtime = RuntimeRepository::update( + &state.db, + existing_runtime.id, + UpdateRuntimeInput { + description: request.description.map(|patch| match patch { + NullableStringPatch::Set(value) => Patch::Set(value), + NullableStringPatch::Clear => Patch::Clear, + }), + name: request.name, + distributions: request.distributions, + installation: request.installation.map(|patch| match patch { + NullableJsonPatch::Set(value) => Patch::Set(value), + NullableJsonPatch::Clear => Patch::Clear, + }), + execution_config: request.execution_config, + }, + ) + .await?; + + Ok(( + StatusCode::OK, + Json(ApiResponse::with_message( + RuntimeResponse::from(runtime), + "Runtime updated successfully", + )), + )) +} + +#[utoipa::path( + delete, + path = "/api/v1/runtimes/{ref}", + tag = "runtimes", + params(("ref" = String, Path, description = "Runtime reference identifier")), + responses( + (status = 200, description = "Runtime deleted successfully", body = SuccessResponse), + (status = 404, description = "Runtime not found") + ), + security(("bearer_auth" = [])) +)] +pub async fn delete_runtime( + State(state): State>, + RequireAuth(_user): RequireAuth, + Path(runtime_ref): Path, +) -> ApiResult { + let runtime = RuntimeRepository::find_by_ref(&state.db, &runtime_ref) + .await? + .ok_or_else(|| ApiError::NotFound(format!("Runtime '{}' not found", runtime_ref)))?; + + let deleted = RuntimeRepository::delete(&state.db, runtime.id).await?; + if !deleted { + return Err(ApiError::NotFound(format!( + "Runtime '{}' not found", + runtime_ref + ))); + } + + Ok(( + StatusCode::OK, + Json(SuccessResponse::new(format!( + "Runtime '{}' deleted successfully", + runtime_ref + ))), + )) +} + +pub fn routes() -> Router> { + Router::new() + .route("/runtimes", get(list_runtimes).post(create_runtime)) + .route( + "/runtimes/{ref}", + get(get_runtime).put(update_runtime).delete(delete_runtime), + ) + .route("/packs/{pack_ref}/runtimes", get(list_runtimes_by_pack)) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_runtime_routes_structure() { + let _router = routes(); + } +} diff --git a/crates/api/src/routes/triggers.rs b/crates/api/src/routes/triggers.rs index f6a082a..70a1dd3 100644 --- a/crates/api/src/routes/triggers.rs +++ b/crates/api/src/routes/triggers.rs @@ -17,7 +17,7 @@ use attune_common::repositories::{ CreateSensorInput, CreateTriggerInput, SensorRepository, SensorSearchFilters, TriggerRepository, TriggerSearchFilters, UpdateSensorInput, UpdateTriggerInput, }, - Create, Delete, FindByRef, Update, + Create, Delete, FindByRef, Patch, Update, }; use crate::{ @@ -25,8 +25,9 @@ use crate::{ dto::{ common::{PaginatedResponse, PaginationParams}, trigger::{ - CreateSensorRequest, CreateTriggerRequest, SensorResponse, SensorSummary, - TriggerResponse, TriggerSummary, UpdateSensorRequest, UpdateTriggerRequest, + CreateSensorRequest, CreateTriggerRequest, SensorJsonPatch, SensorResponse, + SensorSummary, TriggerJsonPatch, TriggerResponse, TriggerStringPatch, + TriggerSummary, UpdateSensorRequest, UpdateTriggerRequest, }, ApiResponse, SuccessResponse, }, @@ -274,10 +275,19 @@ pub async fn update_trigger( // Create update input let update_input = UpdateTriggerInput { label: request.label, - description: request.description, + description: request.description.map(|patch| match patch { + TriggerStringPatch::Set(value) => Patch::Set(value), + TriggerStringPatch::Clear => Patch::Clear, + }), enabled: request.enabled, - param_schema: request.param_schema, - out_schema: request.out_schema, + param_schema: request.param_schema.map(|patch| match patch { + TriggerJsonPatch::Set(value) => Patch::Set(value), + TriggerJsonPatch::Clear => Patch::Clear, + }), + out_schema: request.out_schema.map(|patch| match patch { + TriggerJsonPatch::Set(value) => Patch::Set(value), + TriggerJsonPatch::Clear => Patch::Clear, + }), }; let trigger = TriggerRepository::update(&state.db, existing_trigger.id, update_input).await?; @@ -722,7 +732,10 @@ pub async fn update_sensor( trigger: None, trigger_ref: None, enabled: request.enabled, - param_schema: request.param_schema, + param_schema: request.param_schema.map(|patch| match patch { + SensorJsonPatch::Set(value) => Patch::Set(value), + SensorJsonPatch::Clear => Patch::Clear, + }), config: None, }; diff --git a/crates/api/src/server.rs b/crates/api/src/server.rs index 4c0c94b..d7aecfb 100644 --- a/crates/api/src/server.rs +++ b/crates/api/src/server.rs @@ -47,6 +47,7 @@ impl Server { let api_v1 = Router::new() .merge(routes::pack_routes()) .merge(routes::action_routes()) + .merge(routes::runtime_routes()) .merge(routes::rule_routes()) .merge(routes::execution_routes()) .merge(routes::trigger_routes()) diff --git a/crates/cli/src/commands/pack.rs b/crates/cli/src/commands/pack.rs index 2c3a462..6c5f7ee 100644 --- a/crates/cli/src/commands/pack.rs +++ b/crates/cli/src/commands/pack.rs @@ -1775,19 +1775,26 @@ async fn handle_update( anyhow::bail!("At least one field must be provided to update"); } + #[derive(Serialize)] + #[serde(tag = "op", content = "value", rename_all = "snake_case")] + enum PackDescriptionPatch { + Set(String), + Clear, + } + #[derive(Serialize)] struct UpdatePackRequest { #[serde(skip_serializing_if = "Option::is_none")] label: Option, #[serde(skip_serializing_if = "Option::is_none")] - description: Option, + description: Option, #[serde(skip_serializing_if = "Option::is_none")] version: Option, } let request = UpdatePackRequest { label, - description, + description: description.map(PackDescriptionPatch::Set), version, }; diff --git a/crates/cli/src/commands/trigger.rs b/crates/cli/src/commands/trigger.rs index 4923202..e4a98a3 100644 --- a/crates/cli/src/commands/trigger.rs +++ b/crates/cli/src/commands/trigger.rs @@ -254,19 +254,26 @@ async fn handle_update( anyhow::bail!("At least one field must be provided to update"); } + #[derive(Serialize)] + #[serde(tag = "op", content = "value", rename_all = "snake_case")] + enum TriggerDescriptionPatch { + Set(String), + Clear, + } + #[derive(Serialize)] struct UpdateTriggerRequest { #[serde(skip_serializing_if = "Option::is_none")] label: Option, #[serde(skip_serializing_if = "Option::is_none")] - description: Option, + description: Option, #[serde(skip_serializing_if = "Option::is_none")] enabled: Option, } let request = UpdateTriggerRequest { label, - description, + description: description.map(TriggerDescriptionPatch::Set), enabled, }; diff --git a/crates/common/src/pack_registry/loader.rs b/crates/common/src/pack_registry/loader.rs index d325a53..1a6bb72 100644 --- a/crates/common/src/pack_registry/loader.rs +++ b/crates/common/src/pack_registry/loader.rs @@ -42,7 +42,6 @@ use crate::repositories::action::{ActionRepository, UpdateActionInput}; use crate::repositories::identity::{ CreatePermissionSetInput, PermissionSetRepository, UpdatePermissionSetInput, }; -use crate::repositories::runtime::{CreateRuntimeInput, RuntimeRepository, UpdateRuntimeInput}; use crate::repositories::runtime_version::{ CreateRuntimeVersionInput, RuntimeVersionRepository, UpdateRuntimeVersionInput, }; @@ -53,7 +52,10 @@ use crate::repositories::trigger::{ use crate::repositories::workflow::{ CreateWorkflowDefinitionInput, UpdateWorkflowDefinitionInput, WorkflowDefinitionRepository, }; -use crate::repositories::{Create, Delete, FindById, FindByRef, Update}; +use crate::repositories::{ + runtime::{CreateRuntimeInput, RuntimeRepository, UpdateRuntimeInput}, + Create, Delete, FindById, FindByRef, Patch, Update, +}; use crate::version_matching::extract_version_components; use crate::workflow::parser::parse_workflow_yaml; @@ -405,10 +407,16 @@ impl<'a> PackComponentLoader<'a> { // Check if runtime already exists — update in place if so if let Some(existing) = RuntimeRepository::find_by_ref(self.pool, &runtime_ref).await? { let update_input = UpdateRuntimeInput { - description, + description: Some(match description { + Some(description) => Patch::Set(description), + None => Patch::Clear, + }), name: Some(name), distributions: Some(distributions), - installation, + installation: Some(match installation { + Some(installation) => Patch::Set(installation), + None => Patch::Clear, + }), execution_config: Some(execution_config), }; @@ -547,9 +555,18 @@ impl<'a> PackComponentLoader<'a> { { let update_input = UpdateRuntimeVersionInput { version: None, // version string doesn't change - version_major: Some(version_major), - version_minor: Some(version_minor), - version_patch: Some(version_patch), + version_major: Some(match version_major { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), + version_minor: Some(match version_minor { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), + version_patch: Some(match version_patch { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), execution_config: Some(execution_config), distributions: Some(distributions), is_default: Some(is_default), @@ -713,10 +730,16 @@ impl<'a> PackComponentLoader<'a> { if let Some(existing) = TriggerRepository::find_by_ref(self.pool, &trigger_ref).await? { let update_input = UpdateTriggerInput { label: Some(label), - description: Some(description), + description: Some(Patch::Set(description)), enabled: Some(enabled), - param_schema, - out_schema, + param_schema: Some(match param_schema { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), + out_schema: Some(match out_schema { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), }; match TriggerRepository::update(self.pool, existing.id, update_input).await { @@ -921,7 +944,10 @@ impl<'a> PackComponentLoader<'a> { description: Some(description), entrypoint: Some(entrypoint), runtime: runtime_id, - runtime_version_constraint: Some(runtime_version_constraint), + runtime_version_constraint: Some(match runtime_version_constraint { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), param_schema, out_schema, parameter_delivery: Some(parameter_delivery), @@ -1310,11 +1336,17 @@ impl<'a> PackComponentLoader<'a> { entrypoint: Some(entrypoint), runtime: Some(sensor_runtime_id), runtime_ref: Some(sensor_runtime_ref.clone()), - runtime_version_constraint: Some(runtime_version_constraint.clone()), + runtime_version_constraint: Some(match runtime_version_constraint.clone() { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), trigger: Some(trigger_id.unwrap_or(existing.trigger)), trigger_ref: Some(trigger_ref.unwrap_or(existing.trigger_ref.clone())), enabled: Some(enabled), - param_schema, + param_schema: Some(match param_schema { + Some(value) => Patch::Set(value), + None => Patch::Clear, + }), config: Some(config), }; diff --git a/crates/common/src/repositories/action.rs b/crates/common/src/repositories/action.rs index 8ca17f1..ba496da 100644 --- a/crates/common/src/repositories/action.rs +++ b/crates/common/src/repositories/action.rs @@ -6,7 +6,7 @@ use crate::models::{action::*, enums::PolicyMethod, Id, JsonSchema}; use crate::{Error, Result}; use sqlx::{Executor, Postgres, QueryBuilder}; -use super::{Create, Delete, FindById, FindByRef, List, Repository, Update}; +use super::{Create, Delete, FindById, FindByRef, List, Patch, Repository, Update}; /// Columns selected in all Action queries. Must match the `Action` model's `FromRow` fields. pub const ACTION_COLUMNS: &str = "id, ref, pack, pack_ref, label, description, entrypoint, \ @@ -67,7 +67,7 @@ pub struct UpdateActionInput { pub description: Option, pub entrypoint: Option, pub runtime: Option, - pub runtime_version_constraint: Option>, + pub runtime_version_constraint: Option>, pub param_schema: Option, pub out_schema: Option, pub parameter_delivery: Option, @@ -237,7 +237,10 @@ impl Update for ActionRepository { query.push(", "); } query.push("runtime_version_constraint = "); - query.push_bind(runtime_version_constraint); + match runtime_version_constraint { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } diff --git a/crates/common/src/repositories/artifact.rs b/crates/common/src/repositories/artifact.rs index 7af2721..0896f3c 100644 --- a/crates/common/src/repositories/artifact.rs +++ b/crates/common/src/repositories/artifact.rs @@ -8,7 +8,7 @@ use crate::models::{ use crate::Result; use sqlx::{Executor, Postgres, QueryBuilder}; -use super::{Create, Delete, FindById, FindByRef, List, Repository, Update}; +use super::{Create, Delete, FindById, FindByRef, List, Patch, Repository, Update}; // ============================================================================ // ArtifactRepository @@ -48,12 +48,12 @@ pub struct UpdateArtifactInput { pub visibility: Option, pub retention_policy: Option, pub retention_limit: Option, - pub name: Option, - pub description: Option, - pub content_type: Option, + pub name: Option>, + pub description: Option>, + pub content_type: Option>, pub size_bytes: Option, - pub execution: Option>, - pub data: Option, + pub execution: Option>, + pub data: Option>, } /// Filters for searching artifacts @@ -186,20 +186,62 @@ impl Update for ArtifactRepository { push_field!(input.visibility, "visibility"); push_field!(input.retention_policy, "retention_policy"); push_field!(input.retention_limit, "retention_limit"); - push_field!(&input.name, "name"); - push_field!(&input.description, "description"); - push_field!(&input.content_type, "content_type"); + if let Some(name) = &input.name { + if has_updates { + query.push(", "); + } + query.push("name = "); + match name { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; + has_updates = true; + } + if let Some(description) = &input.description { + if has_updates { + query.push(", "); + } + query.push("description = "); + match description { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; + has_updates = true; + } + if let Some(content_type) = &input.content_type { + if has_updates { + query.push(", "); + } + query.push("content_type = "); + match content_type { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; + has_updates = true; + } push_field!(input.size_bytes, "size_bytes"); - // execution is Option> — outer Option = "was field provided?", - // inner Option = nullable column value if let Some(exec_val) = input.execution { if has_updates { query.push(", "); } - query.push("execution = ").push_bind(exec_val); + query.push("execution = "); + match exec_val { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; + has_updates = true; + } + if let Some(data) = &input.data { + if has_updates { + query.push(", "); + } + query.push("data = "); + match data { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } - push_field!(&input.data, "data"); if !has_updates { return Self::get_by_id(executor, id).await; diff --git a/crates/common/src/repositories/mod.rs b/crates/common/src/repositories/mod.rs index 6323e73..dd17333 100644 --- a/crates/common/src/repositories/mod.rs +++ b/crates/common/src/repositories/mod.rs @@ -66,6 +66,14 @@ pub use runtime_version::RuntimeVersionRepository; pub use trigger::{SensorRepository, TriggerRepository}; pub use workflow::{WorkflowDefinitionRepository, WorkflowExecutionRepository}; +/// Explicit patch operation for update inputs where callers must distinguish +/// between "leave unchanged", "set value", and "clear to NULL". +#[derive(Debug, Clone, PartialEq)] +pub enum Patch { + Set(T), + Clear, +} + /// Type alias for database connection/transaction pub type DbConnection<'c> = &'c mut Transaction<'c, Postgres>; diff --git a/crates/common/src/repositories/pack.rs b/crates/common/src/repositories/pack.rs index 9a77ae7..ee5040b 100644 --- a/crates/common/src/repositories/pack.rs +++ b/crates/common/src/repositories/pack.rs @@ -6,7 +6,7 @@ use crate::models::{pack::Pack, JsonDict, JsonSchema}; use crate::{Error, Result}; use sqlx::{Executor, Postgres, QueryBuilder}; -use super::{Create, Delete, FindById, FindByRef, List, Pagination, Repository, Update}; +use super::{Create, Delete, FindById, FindByRef, List, Pagination, Patch, Repository, Update}; /// Repository for Pack operations pub struct PackRepository; @@ -40,7 +40,7 @@ pub struct CreatePackInput { #[derive(Debug, Clone, Default)] pub struct UpdatePackInput { pub label: Option, - pub description: Option, + pub description: Option>, pub version: Option, pub conf_schema: Option, pub config: Option, @@ -186,7 +186,10 @@ impl Update for PackRepository { query.push(", "); } query.push("description = "); - query.push_bind(description); + match description { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } diff --git a/crates/common/src/repositories/runtime.rs b/crates/common/src/repositories/runtime.rs index ef58ca6..d0ba7a1 100644 --- a/crates/common/src/repositories/runtime.rs +++ b/crates/common/src/repositories/runtime.rs @@ -10,7 +10,7 @@ use crate::models::{ use crate::Result; use sqlx::{Executor, Postgres, QueryBuilder}; -use super::{Create, Delete, FindById, FindByRef, List, Repository, Update}; +use super::{Create, Delete, FindById, FindByRef, List, Patch, Repository, Update}; /// Repository for Runtime operations pub struct RuntimeRepository; @@ -39,10 +39,10 @@ pub struct CreateRuntimeInput { /// Input for updating a runtime #[derive(Debug, Clone, Default)] pub struct UpdateRuntimeInput { - pub description: Option, + pub description: Option>, pub name: Option, pub distributions: Option, - pub installation: Option, + pub installation: Option>, pub execution_config: Option, } @@ -163,7 +163,10 @@ impl Update for RuntimeRepository { if let Some(description) = &input.description { query.push("description = "); - query.push_bind(description); + match description { + Patch::Set(description) => query.push_bind(description), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -190,7 +193,10 @@ impl Update for RuntimeRepository { query.push(", "); } query.push("installation = "); - query.push_bind(installation); + match installation { + Patch::Set(installation) => query.push_bind(installation), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } diff --git a/crates/common/src/repositories/runtime_version.rs b/crates/common/src/repositories/runtime_version.rs index adf0d50..bb643fe 100644 --- a/crates/common/src/repositories/runtime_version.rs +++ b/crates/common/src/repositories/runtime_version.rs @@ -5,7 +5,7 @@ use crate::error::Result; use crate::models::{Id, RuntimeVersion}; -use crate::repositories::{Create, Delete, FindById, List, Repository, Update}; +use crate::repositories::{Create, Delete, FindById, List, Patch, Repository, Update}; use sqlx::{Executor, Postgres, QueryBuilder}; /// Repository for runtime version database operations @@ -39,14 +39,14 @@ pub struct CreateRuntimeVersionInput { #[derive(Debug, Clone, Default)] pub struct UpdateRuntimeVersionInput { pub version: Option, - pub version_major: Option>, - pub version_minor: Option>, - pub version_patch: Option>, + pub version_major: Option>, + pub version_minor: Option>, + pub version_patch: Option>, pub execution_config: Option, pub distributions: Option, pub is_default: Option, pub available: Option, - pub verified_at: Option>>, + pub verified_at: Option>>, pub meta: Option, } @@ -154,7 +154,10 @@ impl Update for RuntimeVersionRepository { query.push(", "); } query.push("version_major = "); - query.push_bind(*version_major); + match version_major { + Patch::Set(value) => query.push_bind(*value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -163,7 +166,10 @@ impl Update for RuntimeVersionRepository { query.push(", "); } query.push("version_minor = "); - query.push_bind(*version_minor); + match version_minor { + Patch::Set(value) => query.push_bind(*value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -172,7 +178,10 @@ impl Update for RuntimeVersionRepository { query.push(", "); } query.push("version_patch = "); - query.push_bind(*version_patch); + match version_patch { + Patch::Set(value) => query.push_bind(*value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -217,7 +226,10 @@ impl Update for RuntimeVersionRepository { query.push(", "); } query.push("verified_at = "); - query.push_bind(*verified_at); + match verified_at { + Patch::Set(value) => query.push_bind(*value), + Patch::Clear => query.push_bind(Option::>::None), + }; has_updates = true; } diff --git a/crates/common/src/repositories/trigger.rs b/crates/common/src/repositories/trigger.rs index 86b51dd..c60dfa8 100644 --- a/crates/common/src/repositories/trigger.rs +++ b/crates/common/src/repositories/trigger.rs @@ -7,7 +7,7 @@ use crate::Result; use serde_json::Value as JsonValue; use sqlx::{Executor, Postgres, QueryBuilder}; -use super::{Create, Delete, FindById, FindByRef, List, Repository, Update}; +use super::{Create, Delete, FindById, FindByRef, List, Patch, Repository, Update}; // ============================================================================ // Trigger Search @@ -88,10 +88,10 @@ pub struct CreateTriggerInput { #[derive(Debug, Clone, Default)] pub struct UpdateTriggerInput { pub label: Option, - pub description: Option, + pub description: Option>, pub enabled: Option, - pub param_schema: Option, - pub out_schema: Option, + pub param_schema: Option>, + pub out_schema: Option>, } #[async_trait::async_trait] @@ -229,7 +229,10 @@ impl Update for TriggerRepository { query.push(", "); } query.push("description = "); - query.push_bind(description); + match description { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -247,7 +250,10 @@ impl Update for TriggerRepository { query.push(", "); } query.push("param_schema = "); - query.push_bind(param_schema); + match param_schema { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -256,7 +262,10 @@ impl Update for TriggerRepository { query.push(", "); } query.push("out_schema = "); - query.push_bind(out_schema); + match out_schema { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -676,11 +685,11 @@ pub struct UpdateSensorInput { pub entrypoint: Option, pub runtime: Option, pub runtime_ref: Option, - pub runtime_version_constraint: Option>, + pub runtime_version_constraint: Option>, pub trigger: Option, pub trigger_ref: Option, pub enabled: Option, - pub param_schema: Option, + pub param_schema: Option>, pub config: Option, } @@ -866,7 +875,10 @@ impl Update for SensorRepository { query.push(", "); } query.push("runtime_version_constraint = "); - query.push_bind(runtime_version_constraint); + match runtime_version_constraint { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } @@ -893,7 +905,10 @@ impl Update for SensorRepository { query.push(", "); } query.push("param_schema = "); - query.push_bind(param_schema); + match param_schema { + Patch::Set(value) => query.push_bind(value), + Patch::Clear => query.push_bind(Option::::None), + }; has_updates = true; } diff --git a/crates/common/tests/pack_repository_tests.rs b/crates/common/tests/pack_repository_tests.rs index 60a178c..e785b71 100644 --- a/crates/common/tests/pack_repository_tests.rs +++ b/crates/common/tests/pack_repository_tests.rs @@ -6,7 +6,9 @@ mod helpers; use attune_common::repositories::pack::{self, PackRepository}; -use attune_common::repositories::{Create, Delete, FindById, FindByRef, List, Pagination, Update}; +use attune_common::repositories::{ + Create, Delete, FindById, FindByRef, List, Pagination, Patch, Update, +}; use attune_common::Error; use helpers::*; use serde_json::json; @@ -214,7 +216,7 @@ async fn test_update_pack() { let update_input = pack::UpdatePackInput { label: Some("Updated Label".to_string()), version: Some("2.0.0".to_string()), - description: Some("Updated description".to_string()), + description: Some(Patch::Set("Updated description".to_string())), ..Default::default() }; diff --git a/crates/common/tests/repository_artifact_tests.rs b/crates/common/tests/repository_artifact_tests.rs index c6ee61d..ed7f73b 100644 --- a/crates/common/tests/repository_artifact_tests.rs +++ b/crates/common/tests/repository_artifact_tests.rs @@ -9,7 +9,7 @@ use attune_common::models::enums::{ use attune_common::repositories::artifact::{ ArtifactRepository, CreateArtifactInput, UpdateArtifactInput, }; -use attune_common::repositories::{Create, Delete, FindById, FindByRef, List, Update}; +use attune_common::repositories::{Create, Delete, FindById, FindByRef, List, Patch, Update}; use attune_common::Error; use sqlx::PgPool; use std::collections::hash_map::DefaultHasher; @@ -267,11 +267,11 @@ async fn test_update_artifact_all_fields() { visibility: Some(ArtifactVisibility::Public), retention_policy: Some(RetentionPolicyType::Days), retention_limit: Some(30), - name: Some("Updated Name".to_string()), - description: Some("Updated description".to_string()), - content_type: Some("image/png".to_string()), + name: Some(Patch::Set("Updated Name".to_string())), + description: Some(Patch::Set("Updated description".to_string())), + content_type: Some(Patch::Set("image/png".to_string())), size_bytes: Some(12345), - data: Some(serde_json::json!({"key": "value"})), + data: Some(Patch::Set(serde_json::json!({"key": "value"}))), execution: None, }; diff --git a/crates/common/tests/repository_runtime_tests.rs b/crates/common/tests/repository_runtime_tests.rs index baa719b..b5f9eeb 100644 --- a/crates/common/tests/repository_runtime_tests.rs +++ b/crates/common/tests/repository_runtime_tests.rs @@ -6,7 +6,7 @@ use attune_common::repositories::runtime::{ CreateRuntimeInput, RuntimeRepository, UpdateRuntimeInput, }; -use attune_common::repositories::{Create, Delete, FindById, FindByRef, List, Update}; +use attune_common::repositories::{Create, Delete, FindById, FindByRef, List, Patch, Update}; use serde_json::json; use sqlx::PgPool; use std::collections::hash_map::DefaultHasher; @@ -259,14 +259,14 @@ async fn test_update_runtime() { .expect("Failed to create runtime"); let update_input = UpdateRuntimeInput { - description: Some("Updated description".to_string()), + description: Some(Patch::Set("Updated description".to_string())), name: Some("updated_name".to_string()), distributions: Some(json!({ "linux": { "supported": false } })), - installation: Some(json!({ + installation: Some(Patch::Set(json!({ "method": "npm" - })), + }))), execution_config: None, }; @@ -275,10 +275,10 @@ async fn test_update_runtime() { .expect("Failed to update runtime"); assert_eq!(updated.id, created.id); - assert_eq!(updated.description, update_input.description); + assert_eq!(updated.description, Some("Updated description".to_string())); assert_eq!(updated.name, update_input.name.unwrap()); assert_eq!(updated.distributions, update_input.distributions.unwrap()); - assert_eq!(updated.installation, update_input.installation); + assert_eq!(updated.installation, Some(json!({ "method": "npm" }))); assert!(updated.updated > created.updated); } @@ -294,7 +294,7 @@ async fn test_update_runtime_partial() { .expect("Failed to create runtime"); let update_input = UpdateRuntimeInput { - description: Some("Only description changed".to_string()), + description: Some(Patch::Set("Only description changed".to_string())), name: None, distributions: None, installation: None, @@ -305,7 +305,10 @@ async fn test_update_runtime_partial() { .await .expect("Failed to update runtime"); - assert_eq!(updated.description, update_input.description); + assert_eq!( + updated.description, + Some("Only description changed".to_string()) + ); assert_eq!(updated.name, created.name); assert_eq!(updated.distributions, created.distributions); assert_eq!(updated.installation, created.installation); @@ -610,7 +613,7 @@ async fn test_update_changes_timestamp() { tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; let update_input = UpdateRuntimeInput { - description: Some("Updated".to_string()), + description: Some(Patch::Set("Updated".to_string())), ..Default::default() }; diff --git a/crates/common/tests/sensor_repository_tests.rs b/crates/common/tests/sensor_repository_tests.rs index fcf6f3a..a8adbdf 100644 --- a/crates/common/tests/sensor_repository_tests.rs +++ b/crates/common/tests/sensor_repository_tests.rs @@ -8,7 +8,7 @@ mod helpers; use attune_common::{ repositories::{ trigger::{CreateSensorInput, SensorRepository, UpdateSensorInput}, - Create, Delete, FindById, FindByRef, List, Update, + Create, Delete, FindById, FindByRef, List, Patch, Update, }, Error, }; @@ -888,7 +888,7 @@ async fn test_update_param_schema() { }); let input = UpdateSensorInput { - param_schema: Some(new_schema.clone()), + param_schema: Some(Patch::Set(new_schema.clone())), ..Default::default() }; @@ -937,7 +937,7 @@ async fn test_update_multiple_fields() { description: Some("Updated multiple fields".to_string()), entrypoint: Some("sensors/multi.py".to_string()), enabled: Some(false), - param_schema: Some(json!({"type": "object"})), + param_schema: Some(Patch::Set(json!({"type": "object"}))), ..Default::default() }; @@ -1766,7 +1766,7 @@ async fn test_param_schema_can_be_null() { // Update to add schema let schema = json!({"type": "object"}); let input = UpdateSensorInput { - param_schema: Some(schema.clone()), + param_schema: Some(Patch::Set(schema.clone())), ..Default::default() }; diff --git a/crates/common/tests/trigger_repository_tests.rs b/crates/common/tests/trigger_repository_tests.rs index 62031a7..5626204 100644 --- a/crates/common/tests/trigger_repository_tests.rs +++ b/crates/common/tests/trigger_repository_tests.rs @@ -8,7 +8,7 @@ mod helpers; use attune_common::{ repositories::{ trigger::{CreateTriggerInput, TriggerRepository, UpdateTriggerInput}, - Create, Delete, FindById, FindByRef, List, Update, + Create, Delete, FindById, FindByRef, List, Patch, Update, }, Error, }; @@ -477,7 +477,7 @@ async fn test_update_trigger() { let update_input = UpdateTriggerInput { label: Some("Updated Label".to_string()), - description: Some("Updated description".to_string()), + description: Some(Patch::Set("Updated description".to_string())), enabled: Some(false), param_schema: None, out_schema: None, @@ -571,8 +571,8 @@ async fn test_update_trigger_schemas() { label: None, description: None, enabled: None, - param_schema: Some(new_param_schema.clone()), - out_schema: Some(new_out_schema.clone()), + param_schema: Some(Patch::Set(new_param_schema.clone())), + out_schema: Some(Patch::Set(new_out_schema.clone())), }; let updated = TriggerRepository::update(&pool, trigger.id, update_input) diff --git a/web/src/App.tsx b/web/src/App.tsx index 0283a5f..551a25f 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -16,6 +16,7 @@ const PackRegisterPage = lazy(() => import("@/pages/packs/PackRegisterPage")); const PackInstallPage = lazy(() => import("@/pages/packs/PackInstallPage")); const PackEditPage = lazy(() => import("@/pages/packs/PackEditPage")); const ActionsPage = lazy(() => import("@/pages/actions/ActionsPage")); +const RuntimesPage = lazy(() => import("@/pages/runtimes/RuntimesPage")); const WorkflowBuilderPage = lazy( () => import("@/pages/actions/WorkflowBuilderPage"), ); @@ -85,6 +86,9 @@ function App() { } /> } /> } /> + } /> + } /> + } /> } diff --git a/web/src/api/core/OpenAPI.ts b/web/src/api/core/OpenAPI.ts index 93ea33b..9f888b9 100644 --- a/web/src/api/core/OpenAPI.ts +++ b/web/src/api/core/OpenAPI.ts @@ -1,32 +1,32 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - -import type { ApiRequestOptions } from "./ApiRequestOptions"; +/* eslint-disable */ +import type { ApiRequestOptions } from './ApiRequestOptions'; type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: "include" | "omit" | "same-origin"; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - HEADERS?: Headers | Resolver | undefined; - ENCODE_PATH?: ((path: string) => string) | undefined; + BASE: string; + VERSION: string; + WITH_CREDENTIALS: boolean; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + HEADERS?: Headers | Resolver | undefined; + ENCODE_PATH?: ((path: string) => string) | undefined; }; export const OpenAPI: OpenAPIConfig = { - BASE: "http://localhost:8080", - VERSION: "0.1.0", - WITH_CREDENTIALS: false, - CREDENTIALS: "include", - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, + BASE: 'http://localhost:8080', + VERSION: '0.1.0', + WITH_CREDENTIALS: false, + CREDENTIALS: 'include', + TOKEN: undefined, + USERNAME: undefined, + PASSWORD: undefined, + HEADERS: undefined, + ENCODE_PATH: undefined, }; diff --git a/web/src/api/index.ts b/web/src/api/index.ts index cc2ad08..306c8aa 100644 --- a/web/src/api/index.ts +++ b/web/src/api/index.ts @@ -1,124 +1,143 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ +/* eslint-disable */ +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI } from './core/OpenAPI'; +export type { OpenAPIConfig } from './core/OpenAPI'; -export { ApiError } from "./core/ApiError"; -export { CancelablePromise, CancelError } from "./core/CancelablePromise"; -export { OpenAPI } from "./core/OpenAPI"; -export type { OpenAPIConfig } from "./core/OpenAPI"; +export type { ActionResponse } from './models/ActionResponse'; +export type { ActionSummary } from './models/ActionSummary'; +export type { ApiResponse_ActionResponse } from './models/ApiResponse_ActionResponse'; +export type { ApiResponse_CurrentUserResponse } from './models/ApiResponse_CurrentUserResponse'; +export type { ApiResponse_EnforcementResponse } from './models/ApiResponse_EnforcementResponse'; +export type { ApiResponse_EventResponse } from './models/ApiResponse_EventResponse'; +export type { ApiResponse_ExecutionResponse } from './models/ApiResponse_ExecutionResponse'; +export type { ApiResponse_IdentitySummary } from './models/ApiResponse_IdentitySummary'; +export type { ApiResponse_InquiryResponse } from './models/ApiResponse_InquiryResponse'; +export type { ApiResponse_KeyResponse } from './models/ApiResponse_KeyResponse'; +export type { ApiResponse_PackInstallResponse } from './models/ApiResponse_PackInstallResponse'; +export type { ApiResponse_PackResponse } from './models/ApiResponse_PackResponse'; +export type { ApiResponse_PermissionAssignmentResponse } from './models/ApiResponse_PermissionAssignmentResponse'; +export type { ApiResponse_QueueStatsResponse } from './models/ApiResponse_QueueStatsResponse'; +export type { ApiResponse_RuleResponse } from './models/ApiResponse_RuleResponse'; +export type { ApiResponse_RuntimeResponse } from './models/ApiResponse_RuntimeResponse'; +export type { ApiResponse_SensorResponse } from './models/ApiResponse_SensorResponse'; +export type { ApiResponse_String } from './models/ApiResponse_String'; +export type { ApiResponse_TokenResponse } from './models/ApiResponse_TokenResponse'; +export type { ApiResponse_TriggerResponse } from './models/ApiResponse_TriggerResponse'; +export type { ApiResponse_WebhookReceiverResponse } from './models/ApiResponse_WebhookReceiverResponse'; +export type { ApiResponse_WorkflowResponse } from './models/ApiResponse_WorkflowResponse'; +export type { ChangePasswordRequest } from './models/ChangePasswordRequest'; +export type { CreateActionRequest } from './models/CreateActionRequest'; +export type { CreateIdentityRequest } from './models/CreateIdentityRequest'; +export type { CreateInquiryRequest } from './models/CreateInquiryRequest'; +export type { CreateKeyRequest } from './models/CreateKeyRequest'; +export type { CreatePackRequest } from './models/CreatePackRequest'; +export type { CreatePermissionAssignmentRequest } from './models/CreatePermissionAssignmentRequest'; +export type { CreateRuleRequest } from './models/CreateRuleRequest'; +export type { CreateRuntimeRequest } from './models/CreateRuntimeRequest'; +export type { CreateSensorRequest } from './models/CreateSensorRequest'; +export type { CreateTriggerRequest } from './models/CreateTriggerRequest'; +export type { CreateWorkflowRequest } from './models/CreateWorkflowRequest'; +export type { CurrentUserResponse } from './models/CurrentUserResponse'; +export { EnforcementCondition } from './models/EnforcementCondition'; +export type { EnforcementResponse } from './models/EnforcementResponse'; +export { EnforcementStatus } from './models/EnforcementStatus'; +export type { EnforcementSummary } from './models/EnforcementSummary'; +export type { EventResponse } from './models/EventResponse'; +export type { EventSummary } from './models/EventSummary'; +export type { ExecutionResponse } from './models/ExecutionResponse'; +export { ExecutionStatus } from './models/ExecutionStatus'; +export type { ExecutionSummary } from './models/ExecutionSummary'; +export type { HealthResponse } from './models/HealthResponse'; +export type { i64 } from './models/i64'; +export type { IdentitySummary } from './models/IdentitySummary'; +export type { InquiryRespondRequest } from './models/InquiryRespondRequest'; +export type { InquiryResponse } from './models/InquiryResponse'; +export { InquiryStatus } from './models/InquiryStatus'; +export type { InquirySummary } from './models/InquirySummary'; +export type { InstallPackRequest } from './models/InstallPackRequest'; +export type { KeyResponse } from './models/KeyResponse'; +export type { KeySummary } from './models/KeySummary'; +export type { LoginRequest } from './models/LoginRequest'; +export { NullableJsonPatch } from './models/NullableJsonPatch'; +export { NullableStringPatch } from './models/NullableStringPatch'; +export { OwnerType } from './models/OwnerType'; +export type { PackInstallResponse } from './models/PackInstallResponse'; +export type { PackResponse } from './models/PackResponse'; +export type { PackSummary } from './models/PackSummary'; +export type { PackTestExecution } from './models/PackTestExecution'; +export type { PackTestResult } from './models/PackTestResult'; +export type { PackTestSummary } from './models/PackTestSummary'; +export type { PackWorkflowSyncResponse } from './models/PackWorkflowSyncResponse'; +export type { PackWorkflowValidationResponse } from './models/PackWorkflowValidationResponse'; +export type { PaginatedResponse_ActionSummary } from './models/PaginatedResponse_ActionSummary'; +export type { PaginatedResponse_EnforcementSummary } from './models/PaginatedResponse_EnforcementSummary'; +export type { PaginatedResponse_EventSummary } from './models/PaginatedResponse_EventSummary'; +export type { PaginatedResponse_ExecutionSummary } from './models/PaginatedResponse_ExecutionSummary'; +export type { PaginatedResponse_IdentitySummary } from './models/PaginatedResponse_IdentitySummary'; +export type { PaginatedResponse_InquirySummary } from './models/PaginatedResponse_InquirySummary'; +export type { PaginatedResponse_KeySummary } from './models/PaginatedResponse_KeySummary'; +export type { PaginatedResponse_PackSummary } from './models/PaginatedResponse_PackSummary'; +export type { PaginatedResponse_PackTestSummary } from './models/PaginatedResponse_PackTestSummary'; +export type { PaginatedResponse_RuleSummary } from './models/PaginatedResponse_RuleSummary'; +export type { PaginatedResponse_RuntimeSummary } from './models/PaginatedResponse_RuntimeSummary'; +export type { PaginatedResponse_SensorSummary } from './models/PaginatedResponse_SensorSummary'; +export type { PaginatedResponse_TriggerSummary } from './models/PaginatedResponse_TriggerSummary'; +export type { PaginatedResponse_WorkflowSummary } from './models/PaginatedResponse_WorkflowSummary'; +export type { PaginationMeta } from './models/PaginationMeta'; +export type { PermissionAssignmentResponse } from './models/PermissionAssignmentResponse'; +export type { PermissionSetSummary } from './models/PermissionSetSummary'; +export type { QueueStatsResponse } from './models/QueueStatsResponse'; +export type { RefreshTokenRequest } from './models/RefreshTokenRequest'; +export type { RegisterPackRequest } from './models/RegisterPackRequest'; +export type { RegisterRequest } from './models/RegisterRequest'; +export type { RuleResponse } from './models/RuleResponse'; +export type { RuleSummary } from './models/RuleSummary'; +export type { RuntimeResponse } from './models/RuntimeResponse'; +export type { RuntimeSummary } from './models/RuntimeSummary'; +export type { SensorResponse } from './models/SensorResponse'; +export type { SensorSummary } from './models/SensorSummary'; +export type { SuccessResponse } from './models/SuccessResponse'; +export type { TestCaseResult } from './models/TestCaseResult'; +export { TestStatus } from './models/TestStatus'; +export type { TestSuiteResult } from './models/TestSuiteResult'; +export type { TokenResponse } from './models/TokenResponse'; +export type { TriggerResponse } from './models/TriggerResponse'; +export type { TriggerSummary } from './models/TriggerSummary'; +export type { UpdateActionRequest } from './models/UpdateActionRequest'; +export type { UpdateIdentityRequest } from './models/UpdateIdentityRequest'; +export type { UpdateInquiryRequest } from './models/UpdateInquiryRequest'; +export type { UpdateKeyRequest } from './models/UpdateKeyRequest'; +export type { UpdatePackRequest } from './models/UpdatePackRequest'; +export type { UpdateRuleRequest } from './models/UpdateRuleRequest'; +export type { UpdateRuntimeRequest } from './models/UpdateRuntimeRequest'; +export type { UpdateSensorRequest } from './models/UpdateSensorRequest'; +export type { UpdateTriggerRequest } from './models/UpdateTriggerRequest'; +export type { UpdateWorkflowRequest } from './models/UpdateWorkflowRequest'; +export type { UserInfo } from './models/UserInfo'; +export type { Value } from './models/Value'; +export type { WebhookReceiverRequest } from './models/WebhookReceiverRequest'; +export type { WebhookReceiverResponse } from './models/WebhookReceiverResponse'; +export type { WorkflowResponse } from './models/WorkflowResponse'; +export type { WorkflowSummary } from './models/WorkflowSummary'; +export type { WorkflowSyncResult } from './models/WorkflowSyncResult'; -export type { ActionResponse } from "./models/ActionResponse"; -export type { ActionSummary } from "./models/ActionSummary"; -export type { ApiResponse_ActionResponse } from "./models/ApiResponse_ActionResponse"; -export type { ApiResponse_CurrentUserResponse } from "./models/ApiResponse_CurrentUserResponse"; -export type { ApiResponse_EnforcementResponse } from "./models/ApiResponse_EnforcementResponse"; -export type { ApiResponse_EventResponse } from "./models/ApiResponse_EventResponse"; -export type { ApiResponse_ExecutionResponse } from "./models/ApiResponse_ExecutionResponse"; -export type { ApiResponse_InquiryResponse } from "./models/ApiResponse_InquiryResponse"; -export type { ApiResponse_KeyResponse } from "./models/ApiResponse_KeyResponse"; -export type { ApiResponse_PackInstallResponse } from "./models/ApiResponse_PackInstallResponse"; -export type { ApiResponse_PackResponse } from "./models/ApiResponse_PackResponse"; -export type { ApiResponse_QueueStatsResponse } from "./models/ApiResponse_QueueStatsResponse"; -export type { ApiResponse_RuleResponse } from "./models/ApiResponse_RuleResponse"; -export type { ApiResponse_SensorResponse } from "./models/ApiResponse_SensorResponse"; -export type { ApiResponse_String } from "./models/ApiResponse_String"; -export type { ApiResponse_TokenResponse } from "./models/ApiResponse_TokenResponse"; -export type { ApiResponse_TriggerResponse } from "./models/ApiResponse_TriggerResponse"; -export type { ApiResponse_WebhookReceiverResponse } from "./models/ApiResponse_WebhookReceiverResponse"; -export type { ApiResponse_WorkflowResponse } from "./models/ApiResponse_WorkflowResponse"; -export type { ChangePasswordRequest } from "./models/ChangePasswordRequest"; -export type { CreateActionRequest } from "./models/CreateActionRequest"; -export type { CreateInquiryRequest } from "./models/CreateInquiryRequest"; -export type { CreateKeyRequest } from "./models/CreateKeyRequest"; -export type { CreatePackRequest } from "./models/CreatePackRequest"; -export type { CreateRuleRequest } from "./models/CreateRuleRequest"; -export type { CreateSensorRequest } from "./models/CreateSensorRequest"; -export type { CreateTriggerRequest } from "./models/CreateTriggerRequest"; -export type { CreateWorkflowRequest } from "./models/CreateWorkflowRequest"; -export type { CurrentUserResponse } from "./models/CurrentUserResponse"; -export { EnforcementCondition } from "./models/EnforcementCondition"; -export type { EnforcementResponse } from "./models/EnforcementResponse"; -export { EnforcementStatus } from "./models/EnforcementStatus"; -export type { EnforcementSummary } from "./models/EnforcementSummary"; -export type { EventResponse } from "./models/EventResponse"; -export type { EventSummary } from "./models/EventSummary"; -export type { ExecutionResponse } from "./models/ExecutionResponse"; -export { ExecutionStatus } from "./models/ExecutionStatus"; -export type { ExecutionSummary } from "./models/ExecutionSummary"; -export type { HealthResponse } from "./models/HealthResponse"; -export type { i64 } from "./models/i64"; -export type { InquiryRespondRequest } from "./models/InquiryRespondRequest"; -export type { InquiryResponse } from "./models/InquiryResponse"; -export { InquiryStatus } from "./models/InquiryStatus"; -export type { InquirySummary } from "./models/InquirySummary"; -export type { InstallPackRequest } from "./models/InstallPackRequest"; -export type { KeyResponse } from "./models/KeyResponse"; -export type { KeySummary } from "./models/KeySummary"; -export type { LoginRequest } from "./models/LoginRequest"; -export { OwnerType } from "./models/OwnerType"; -export type { PackInstallResponse } from "./models/PackInstallResponse"; -export type { PackResponse } from "./models/PackResponse"; -export type { PackSummary } from "./models/PackSummary"; -export type { PackTestExecution } from "./models/PackTestExecution"; -export type { PackTestResult } from "./models/PackTestResult"; -export type { PackTestSummary } from "./models/PackTestSummary"; -export type { PackWorkflowSyncResponse } from "./models/PackWorkflowSyncResponse"; -export type { PackWorkflowValidationResponse } from "./models/PackWorkflowValidationResponse"; -export type { PaginatedResponse_ActionSummary } from "./models/PaginatedResponse_ActionSummary"; -export type { PaginatedResponse_EnforcementSummary } from "./models/PaginatedResponse_EnforcementSummary"; -export type { PaginatedResponse_EventSummary } from "./models/PaginatedResponse_EventSummary"; -export type { PaginatedResponse_ExecutionSummary } from "./models/PaginatedResponse_ExecutionSummary"; -export type { PaginatedResponse_InquirySummary } from "./models/PaginatedResponse_InquirySummary"; -export type { PaginatedResponse_KeySummary } from "./models/PaginatedResponse_KeySummary"; -export type { PaginatedResponse_PackSummary } from "./models/PaginatedResponse_PackSummary"; -export type { PaginatedResponse_PackTestSummary } from "./models/PaginatedResponse_PackTestSummary"; -export type { PaginatedResponse_RuleSummary } from "./models/PaginatedResponse_RuleSummary"; -export type { PaginatedResponse_SensorSummary } from "./models/PaginatedResponse_SensorSummary"; -export type { PaginatedResponse_TriggerSummary } from "./models/PaginatedResponse_TriggerSummary"; -export type { PaginatedResponse_WorkflowSummary } from "./models/PaginatedResponse_WorkflowSummary"; -export type { PaginationMeta } from "./models/PaginationMeta"; -export type { QueueStatsResponse } from "./models/QueueStatsResponse"; -export type { RefreshTokenRequest } from "./models/RefreshTokenRequest"; -export type { RegisterPackRequest } from "./models/RegisterPackRequest"; -export type { RegisterRequest } from "./models/RegisterRequest"; -export type { RuleResponse } from "./models/RuleResponse"; -export type { RuleSummary } from "./models/RuleSummary"; -export type { SensorResponse } from "./models/SensorResponse"; -export type { SensorSummary } from "./models/SensorSummary"; -export type { SuccessResponse } from "./models/SuccessResponse"; -export type { TestCaseResult } from "./models/TestCaseResult"; -export { TestStatus } from "./models/TestStatus"; -export type { TestSuiteResult } from "./models/TestSuiteResult"; -export type { TokenResponse } from "./models/TokenResponse"; -export type { TriggerResponse } from "./models/TriggerResponse"; -export type { TriggerSummary } from "./models/TriggerSummary"; -export type { UpdateActionRequest } from "./models/UpdateActionRequest"; -export type { UpdateInquiryRequest } from "./models/UpdateInquiryRequest"; -export type { UpdateKeyRequest } from "./models/UpdateKeyRequest"; -export type { UpdatePackRequest } from "./models/UpdatePackRequest"; -export type { UpdateRuleRequest } from "./models/UpdateRuleRequest"; -export type { UpdateSensorRequest } from "./models/UpdateSensorRequest"; -export type { UpdateTriggerRequest } from "./models/UpdateTriggerRequest"; -export type { UpdateWorkflowRequest } from "./models/UpdateWorkflowRequest"; -export type { UserInfo } from "./models/UserInfo"; -export type { Value } from "./models/Value"; -export type { WebhookReceiverRequest } from "./models/WebhookReceiverRequest"; -export type { WebhookReceiverResponse } from "./models/WebhookReceiverResponse"; -export type { WorkflowResponse } from "./models/WorkflowResponse"; -export type { WorkflowSummary } from "./models/WorkflowSummary"; -export type { WorkflowSyncResult } from "./models/WorkflowSyncResult"; - -export { ActionsService } from "./services/ActionsService"; -export { AuthService } from "./services/AuthService"; -export { EnforcementsService } from "./services/EnforcementsService"; -export { EventsService } from "./services/EventsService"; -export { ExecutionsService } from "./services/ExecutionsService"; -export { HealthService } from "./services/HealthService"; -export { InquiriesService } from "./services/InquiriesService"; -export { PacksService } from "./services/PacksService"; -export { RulesService } from "./services/RulesService"; -export { SecretsService } from "./services/SecretsService"; -export { SensorsService } from "./services/SensorsService"; -export { TriggersService } from "./services/TriggersService"; -export { WebhooksService } from "./services/WebhooksService"; -export { WorkflowsService } from "./services/WorkflowsService"; +export { ActionsService } from './services/ActionsService'; +export { AuthService } from './services/AuthService'; +export { EnforcementsService } from './services/EnforcementsService'; +export { EventsService } from './services/EventsService'; +export { ExecutionsService } from './services/ExecutionsService'; +export { HealthService } from './services/HealthService'; +export { InquiriesService } from './services/InquiriesService'; +export { PacksService } from './services/PacksService'; +export { PermissionsService } from './services/PermissionsService'; +export { RulesService } from './services/RulesService'; +export { RuntimesService } from './services/RuntimesService'; +export { SecretsService } from './services/SecretsService'; +export { SensorsService } from './services/SensorsService'; +export { TriggersService } from './services/TriggersService'; +export { WebhooksService } from './services/WebhooksService'; +export { WorkflowsService } from './services/WorkflowsService'; diff --git a/web/src/api/models/ActionResponse.ts b/web/src/api/models/ActionResponse.ts index e5f783b..00eec88 100644 --- a/web/src/api/models/ActionResponse.ts +++ b/web/src/api/models/ActionResponse.ts @@ -6,64 +6,65 @@ * Response DTO for action information */ export type ActionResponse = { - /** - * Creation timestamp - */ - created: string; - /** - * Action description - */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Whether this is an ad-hoc action (not from pack installation) - */ - is_adhoc: boolean; - /** - * Human-readable label - */ - label: string; - /** - * Output schema - */ - out_schema: any | null; - /** - * Pack ID - */ - pack: number; - /** - * Pack reference - */ - pack_ref: string; - /** - * Parameter schema (StackStorm-style with inline required/secret) - */ - param_schema: any | null; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Whether this is an ad-hoc action (not from pack installation) + */ + is_adhoc: boolean; + /** + * Human-readable label + */ + label: string; + /** + * Output schema + */ + out_schema: any | null; + /** + * Pack ID + */ + pack: number; + /** + * Pack reference + */ + pack_ref: string; + /** + * Parameter schema (StackStorm-style with inline required/secret) + */ + param_schema: any | null; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; }; + diff --git a/web/src/api/models/ActionSummary.ts b/web/src/api/models/ActionSummary.ts index 930284e..4ed5ef1 100644 --- a/web/src/api/models/ActionSummary.ts +++ b/web/src/api/models/ActionSummary.ts @@ -1,53 +1,54 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Simplified action response (for list endpoints) */ export type ActionSummary = { - /** - * Creation timestamp - */ - created: string; - /** - * Action description - */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Human-readable label - */ - label: string; - /** - * Pack reference - */ - pack_ref: string; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Human-readable label + */ + label: string; + /** + * Pack reference + */ + pack_ref: string; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; }; + diff --git a/web/src/api/models/ApiResponse_ActionResponse.ts b/web/src/api/models/ApiResponse_ActionResponse.ts index 6f60675..6ba9fca 100644 --- a/web/src/api/models/ApiResponse_ActionResponse.ts +++ b/web/src/api/models/ApiResponse_ActionResponse.ts @@ -6,73 +6,74 @@ * Standard API response wrapper */ export type ApiResponse_ActionResponse = { - /** - * Response DTO for action information - */ - data: { /** - * Creation timestamp + * Response DTO for action information */ - created: string; + data: { + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Whether this is an ad-hoc action (not from pack installation) + */ + is_adhoc: boolean; + /** + * Human-readable label + */ + label: string; + /** + * Output schema + */ + out_schema: any | null; + /** + * Pack ID + */ + pack: number; + /** + * Pack reference + */ + pack_ref: string; + /** + * Parameter schema (StackStorm-style with inline required/secret) + */ + param_schema: any | null; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; + }; /** - * Action description + * Optional message */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Whether this is an ad-hoc action (not from pack installation) - */ - is_adhoc: boolean; - /** - * Human-readable label - */ - label: string; - /** - * Output schema - */ - out_schema: any | null; - /** - * Pack ID - */ - pack: number; - /** - * Pack reference - */ - pack_ref: string; - /** - * Parameter schema (StackStorm-style with inline required/secret) - */ - param_schema: any | null; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; - }; - /** - * Optional message - */ - message?: string | null; + message?: string | null; }; + diff --git a/web/src/api/models/ApiResponse_CurrentUserResponse.ts b/web/src/api/models/ApiResponse_CurrentUserResponse.ts index 9f5604c..6b1b58d 100644 --- a/web/src/api/models/ApiResponse_CurrentUserResponse.ts +++ b/web/src/api/models/ApiResponse_CurrentUserResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Standard API response wrapper */ diff --git a/web/src/api/models/ApiResponse_ExecutionResponse.ts b/web/src/api/models/ApiResponse_ExecutionResponse.ts index efcb13a..dcb599c 100644 --- a/web/src/api/models/ApiResponse_ExecutionResponse.ts +++ b/web/src/api/models/ApiResponse_ExecutionResponse.ts @@ -2,88 +2,76 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ExecutionStatus } from "./ExecutionStatus"; +import type { ExecutionStatus } from './ExecutionStatus'; /** * Standard API response wrapper */ export type ApiResponse_ExecutionResponse = { - /** - * Response DTO for execution information - */ - data: { /** - * Action ID (optional, may be null for ad-hoc executions) + * Response DTO for execution information */ - action?: number | null; + data: { + /** + * Action ID (optional, may be null for ad-hoc executions) + */ + action?: number | null; + /** + * Action reference + */ + action_ref: string; + /** + * Execution configuration/parameters + */ + config: Record; + /** + * Creation timestamp + */ + created: string; + /** + * Enforcement ID (rule enforcement that triggered this) + */ + enforcement?: number | null; + /** + * Identity ID that initiated this execution + */ + executor?: number | null; + /** + * Execution ID + */ + id: number; + /** + * Parent execution ID (for nested/child executions) + */ + parent?: number | null; + /** + * Execution result/output + */ + result: Record; + /** + * When the execution actually started running (worker picked it up). + * Null if the execution hasn't started running yet. + */ + started_at?: string | null; + /** + * Execution status + */ + status: ExecutionStatus; + /** + * Last update timestamp + */ + updated: string; + /** + * Worker ID currently assigned to this execution + */ + worker?: number | null; + /** + * Workflow task metadata (only populated for workflow task executions) + */ + workflow_task?: any | null; + }; /** - * Action reference + * Optional message */ - action_ref: string; - /** - * Execution configuration/parameters - */ - config: Record; - /** - * Creation timestamp - */ - created: string; - /** - * Enforcement ID (rule enforcement that triggered this) - */ - enforcement?: number | null; - /** - * Identity ID that initiated this execution - */ - executor?: number | null; - /** - * Execution ID - */ - id: number; - /** - * Parent execution ID (for nested/child executions) - */ - parent?: number | null; - /** - * Worker ID currently assigned to this execution - */ - worker?: number | null; - /** - * Execution result/output - */ - result: Record; - /** - * When the execution actually started running (worker picked it up). - * Null if the execution hasn't started running yet. - */ - started_at?: string | null; - /** - * Execution status - */ - status: ExecutionStatus; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow task metadata (only populated for workflow task executions) - */ - workflow_task?: { - workflow_execution: number; - task_name: string; - task_index?: number | null; - task_batch?: number | null; - retry_count: number; - max_retries: number; - next_retry_at?: string | null; - timeout_seconds?: number | null; - timed_out: boolean; - duration_ms?: number | null; - started_at?: string | null; - completed_at?: string | null; - } | null; - }; - /** - * Optional message - */ - message?: string | null; + message?: string | null; }; + diff --git a/web/src/api/models/ApiResponse_IdentitySummary.ts b/web/src/api/models/ApiResponse_IdentitySummary.ts new file mode 100644 index 0000000..3ac5c88 --- /dev/null +++ b/web/src/api/models/ApiResponse_IdentitySummary.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Value } from './Value'; +/** + * Standard API response wrapper + */ +export type ApiResponse_IdentitySummary = { + data: { + attributes: Value; + display_name?: string | null; + id: number; + login: string; + }; + /** + * Optional message + */ + message?: string | null; +}; + diff --git a/web/src/api/models/ApiResponse_KeyResponse.ts b/web/src/api/models/ApiResponse_KeyResponse.ts index 1738b41..30bda41 100644 --- a/web/src/api/models/ApiResponse_KeyResponse.ts +++ b/web/src/api/models/ApiResponse_KeyResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { OwnerType } from './OwnerType'; /** @@ -61,9 +61,9 @@ export type ApiResponse_KeyResponse = { */ updated: string; /** - * The secret value (decrypted if encrypted) + * The secret value (decrypted if encrypted). Can be a string, object, array, number, or boolean. */ - value: string; + value: any; }; /** * Optional message diff --git a/web/src/api/models/ApiResponse_PackInstallResponse.ts b/web/src/api/models/ApiResponse_PackInstallResponse.ts index e1d928c..340251c 100644 --- a/web/src/api/models/ApiResponse_PackInstallResponse.ts +++ b/web/src/api/models/ApiResponse_PackInstallResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { PackResponse } from './PackResponse'; import type { PackTestResult } from './PackTestResult'; /** diff --git a/web/src/api/models/ApiResponse_PermissionAssignmentResponse.ts b/web/src/api/models/ApiResponse_PermissionAssignmentResponse.ts new file mode 100644 index 0000000..ee61bb8 --- /dev/null +++ b/web/src/api/models/ApiResponse_PermissionAssignmentResponse.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Standard API response wrapper + */ +export type ApiResponse_PermissionAssignmentResponse = { + data: { + created: string; + id: number; + identity_id: number; + permission_set_id: number; + permission_set_ref: string; + }; + /** + * Optional message + */ + message?: string | null; +}; + diff --git a/web/src/api/models/ApiResponse_QueueStatsResponse.ts b/web/src/api/models/ApiResponse_QueueStatsResponse.ts index a7e623e..03eff9c 100644 --- a/web/src/api/models/ApiResponse_QueueStatsResponse.ts +++ b/web/src/api/models/ApiResponse_QueueStatsResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Standard API response wrapper */ diff --git a/web/src/api/models/ApiResponse_RuntimeResponse.ts b/web/src/api/models/ApiResponse_RuntimeResponse.ts new file mode 100644 index 0000000..9e37f4e --- /dev/null +++ b/web/src/api/models/ApiResponse_RuntimeResponse.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Standard API response wrapper + */ +export type ApiResponse_RuntimeResponse = { + /** + * Full runtime response. + */ + data: { + created: string; + description?: string | null; + distributions: Record; + execution_config: Record; + id: number; + installation: any | null; + name: string; + pack?: number | null; + pack_ref?: string | null; + ref: string; + updated: string; + }; + /** + * Optional message + */ + message?: string | null; +}; + diff --git a/web/src/api/models/ApiResponse_String.ts b/web/src/api/models/ApiResponse_String.ts index 5fba4c1..4a2cb12 100644 --- a/web/src/api/models/ApiResponse_String.ts +++ b/web/src/api/models/ApiResponse_String.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Standard API response wrapper */ diff --git a/web/src/api/models/ApiResponse_TokenResponse.ts b/web/src/api/models/ApiResponse_TokenResponse.ts index e684e12..9208959 100644 --- a/web/src/api/models/ApiResponse_TokenResponse.ts +++ b/web/src/api/models/ApiResponse_TokenResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { UserInfo } from './UserInfo'; /** * Standard API response wrapper diff --git a/web/src/api/models/ApiResponse_WebhookReceiverResponse.ts b/web/src/api/models/ApiResponse_WebhookReceiverResponse.ts index 8670802..e056064 100644 --- a/web/src/api/models/ApiResponse_WebhookReceiverResponse.ts +++ b/web/src/api/models/ApiResponse_WebhookReceiverResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Standard API response wrapper */ diff --git a/web/src/api/models/ApiResponse_WorkflowResponse.ts b/web/src/api/models/ApiResponse_WorkflowResponse.ts index 2691c08..53d9d2d 100644 --- a/web/src/api/models/ApiResponse_WorkflowResponse.ts +++ b/web/src/api/models/ApiResponse_WorkflowResponse.ts @@ -68,3 +68,4 @@ export type ApiResponse_WorkflowResponse = { */ message?: string | null; }; + diff --git a/web/src/api/models/ChangePasswordRequest.ts b/web/src/api/models/ChangePasswordRequest.ts index 590d80f..4f3ed13 100644 --- a/web/src/api/models/ChangePasswordRequest.ts +++ b/web/src/api/models/ChangePasswordRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Change password request */ diff --git a/web/src/api/models/CreateIdentityRequest.ts b/web/src/api/models/CreateIdentityRequest.ts new file mode 100644 index 0000000..a6a1c43 --- /dev/null +++ b/web/src/api/models/CreateIdentityRequest.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Value } from './Value'; +export type CreateIdentityRequest = { + attributes?: Value; + display_name?: string | null; + login: string; + password?: string | null; +}; + diff --git a/web/src/api/models/CreateKeyRequest.ts b/web/src/api/models/CreateKeyRequest.ts index 3698467..a377f03 100644 --- a/web/src/api/models/CreateKeyRequest.ts +++ b/web/src/api/models/CreateKeyRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { OwnerType } from './OwnerType'; /** @@ -9,7 +9,7 @@ import type { OwnerType } from './OwnerType'; */ export type CreateKeyRequest = { /** - * Whether to encrypt the value (recommended: true) + * Whether to encrypt the value at rest (default: false; use --encrypt / -e from CLI) */ encrypted?: boolean; /** @@ -45,8 +45,8 @@ export type CreateKeyRequest = { */ ref: string; /** - * The secret value to store + * The secret value to store. Can be a string, object, array, number, or boolean. */ - value: string; + value: any; }; diff --git a/web/src/api/models/CreatePermissionAssignmentRequest.ts b/web/src/api/models/CreatePermissionAssignmentRequest.ts new file mode 100644 index 0000000..f2b989e --- /dev/null +++ b/web/src/api/models/CreatePermissionAssignmentRequest.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreatePermissionAssignmentRequest = { + identity_id?: number | null; + identity_login?: string | null; + permission_set_ref: string; +}; + diff --git a/web/src/api/models/CreateRuntimeRequest.ts b/web/src/api/models/CreateRuntimeRequest.ts new file mode 100644 index 0000000..1139946 --- /dev/null +++ b/web/src/api/models/CreateRuntimeRequest.ts @@ -0,0 +1,38 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Request DTO for creating a runtime. + */ +export type CreateRuntimeRequest = { + /** + * Optional human-readable description + */ + description?: string | null; + /** + * Distribution metadata used for verification and platform support + */ + distributions?: Record; + /** + * Runtime execution configuration + */ + execution_config?: Record; + /** + * Optional installation metadata + */ + installation?: any | null; + /** + * Display name + */ + name: string; + /** + * Optional pack reference this runtime belongs to + */ + pack_ref?: string | null; + /** + * Unique reference identifier (e.g. "core.python", "core.nodejs") + */ + ref: string; +}; + diff --git a/web/src/api/models/CreateWorkflowRequest.ts b/web/src/api/models/CreateWorkflowRequest.ts index eaca4ee..d940884 100644 --- a/web/src/api/models/CreateWorkflowRequest.ts +++ b/web/src/api/models/CreateWorkflowRequest.ts @@ -43,3 +43,4 @@ export type CreateWorkflowRequest = { */ version: string; }; + diff --git a/web/src/api/models/CurrentUserResponse.ts b/web/src/api/models/CurrentUserResponse.ts index f13ef4b..f3197e1 100644 --- a/web/src/api/models/CurrentUserResponse.ts +++ b/web/src/api/models/CurrentUserResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Current user response */ diff --git a/web/src/api/models/EnforcementCondition.ts b/web/src/api/models/EnforcementCondition.ts index 1d48f0c..84cfee7 100644 --- a/web/src/api/models/EnforcementCondition.ts +++ b/web/src/api/models/EnforcementCondition.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ export enum EnforcementCondition { ANY = 'any', ALL = 'all', diff --git a/web/src/api/models/EnforcementStatus.ts b/web/src/api/models/EnforcementStatus.ts index f8de91e..0f34187 100644 --- a/web/src/api/models/EnforcementStatus.ts +++ b/web/src/api/models/EnforcementStatus.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ export enum EnforcementStatus { CREATED = 'created', PROCESSED = 'processed', diff --git a/web/src/api/models/EnforcementSummary.ts b/web/src/api/models/EnforcementSummary.ts index 84ff524..5527d05 100644 --- a/web/src/api/models/EnforcementSummary.ts +++ b/web/src/api/models/EnforcementSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { EnforcementCondition } from './EnforcementCondition'; import type { EnforcementStatus } from './EnforcementStatus'; import type { i64 } from './i64'; diff --git a/web/src/api/models/EventSummary.ts b/web/src/api/models/EventSummary.ts index 18bce8c..611f4f1 100644 --- a/web/src/api/models/EventSummary.ts +++ b/web/src/api/models/EventSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; /** * Summary event response for list views diff --git a/web/src/api/models/ExecutionResponse.ts b/web/src/api/models/ExecutionResponse.ts index 15de79d..c6fc7be 100644 --- a/web/src/api/models/ExecutionResponse.ts +++ b/web/src/api/models/ExecutionResponse.ts @@ -2,80 +2,67 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ExecutionStatus } from "./ExecutionStatus"; +import type { ExecutionStatus } from './ExecutionStatus'; /** * Response DTO for execution information */ export type ExecutionResponse = { - /** - * Action ID (optional, may be null for ad-hoc executions) - */ - action?: number | null; - /** - * Action reference - */ - action_ref: string; - /** - * Execution configuration/parameters - */ - config: Record; - /** - * Creation timestamp - */ - created: string; - /** - * Enforcement ID (rule enforcement that triggered this) - */ - enforcement?: number | null; - /** - * Identity ID that initiated this execution - */ - executor?: number | null; - /** - * Execution ID - */ - id: number; - /** - * Parent execution ID (for nested/child executions) - */ - parent?: number | null; - /** - * Worker ID currently assigned to this execution - */ - worker?: number | null; - /** - * Execution result/output - */ - result: Record; - /** - * When the execution actually started running (worker picked it up). - * Null if the execution hasn't started running yet. - */ - started_at?: string | null; - /** - * Execution status - */ - status: ExecutionStatus; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow task metadata (only populated for workflow task executions) - */ - workflow_task?: { - workflow_execution: number; - task_name: string; - triggered_by?: string | null; - task_index?: number | null; - task_batch?: number | null; - retry_count: number; - max_retries: number; - next_retry_at?: string | null; - timeout_seconds?: number | null; - timed_out: boolean; - duration_ms?: number | null; + /** + * Action ID (optional, may be null for ad-hoc executions) + */ + action?: number | null; + /** + * Action reference + */ + action_ref: string; + /** + * Execution configuration/parameters + */ + config: Record; + /** + * Creation timestamp + */ + created: string; + /** + * Enforcement ID (rule enforcement that triggered this) + */ + enforcement?: number | null; + /** + * Identity ID that initiated this execution + */ + executor?: number | null; + /** + * Execution ID + */ + id: number; + /** + * Parent execution ID (for nested/child executions) + */ + parent?: number | null; + /** + * Execution result/output + */ + result: Record; + /** + * When the execution actually started running (worker picked it up). + * Null if the execution hasn't started running yet. + */ started_at?: string | null; - completed_at?: string | null; - } | null; + /** + * Execution status + */ + status: ExecutionStatus; + /** + * Last update timestamp + */ + updated: string; + /** + * Worker ID currently assigned to this execution + */ + worker?: number | null; + /** + * Workflow task metadata (only populated for workflow task executions) + */ + workflow_task?: any | null; }; + diff --git a/web/src/api/models/ExecutionStatus.ts b/web/src/api/models/ExecutionStatus.ts index 67dc334..97eb85e 100644 --- a/web/src/api/models/ExecutionStatus.ts +++ b/web/src/api/models/ExecutionStatus.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ export enum ExecutionStatus { REQUESTED = 'requested', SCHEDULING = 'scheduling', diff --git a/web/src/api/models/ExecutionSummary.ts b/web/src/api/models/ExecutionSummary.ts index eb1ee42..35d4525 100644 --- a/web/src/api/models/ExecutionSummary.ts +++ b/web/src/api/models/ExecutionSummary.ts @@ -1,69 +1,56 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - -import type { ExecutionStatus } from "./ExecutionStatus"; +/* eslint-disable */ +import type { ExecutionStatus } from './ExecutionStatus'; /** * Simplified execution response (for list endpoints) */ export type ExecutionSummary = { - /** - * Action reference - */ - action_ref: string; - /** - * Creation timestamp - */ - created: string; - /** - * Enforcement ID - */ - enforcement?: number | null; - /** - * Execution ID - */ - id: number; - /** - * Parent execution ID - */ - parent?: number | null; - /** - * Rule reference (if triggered by a rule) - */ - rule_ref?: string | null; - /** - * Execution status - */ - status: ExecutionStatus; - /** - * When the execution actually started running (worker picked it up). - * Null if the execution hasn't started running yet. - */ - started_at?: string | null; - /** - * Trigger reference (if triggered by a trigger) - */ - trigger_ref?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow task metadata (only populated for workflow task executions) - */ - workflow_task?: { - workflow_execution: number; - task_name: string; - triggered_by?: string | null; - task_index?: number | null; - task_batch?: number | null; - retry_count: number; - max_retries: number; - next_retry_at?: string | null; - timeout_seconds?: number | null; - timed_out: boolean; - duration_ms?: number | null; + /** + * Action reference + */ + action_ref: string; + /** + * Creation timestamp + */ + created: string; + /** + * Enforcement ID + */ + enforcement?: number | null; + /** + * Execution ID + */ + id: number; + /** + * Parent execution ID + */ + parent?: number | null; + /** + * Rule reference (if triggered by a rule) + */ + rule_ref?: string | null; + /** + * When the execution actually started running (worker picked it up). + * Null if the execution hasn't started running yet. + */ started_at?: string | null; - completed_at?: string | null; - } | null; + /** + * Execution status + */ + status: ExecutionStatus; + /** + * Trigger reference (if triggered by a trigger) + */ + trigger_ref?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow task metadata (only populated for workflow task executions) + */ + workflow_task?: any | null; }; + diff --git a/web/src/api/models/HealthResponse.ts b/web/src/api/models/HealthResponse.ts index ab16625..d4dbb93 100644 --- a/web/src/api/models/HealthResponse.ts +++ b/web/src/api/models/HealthResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Health check response */ diff --git a/web/src/api/models/IdentitySummary.ts b/web/src/api/models/IdentitySummary.ts new file mode 100644 index 0000000..4feb44e --- /dev/null +++ b/web/src/api/models/IdentitySummary.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Value } from './Value'; +export type IdentitySummary = { + attributes: Value; + display_name?: string | null; + id: number; + login: string; +}; + diff --git a/web/src/api/models/InquiryStatus.ts b/web/src/api/models/InquiryStatus.ts index 553aca4..4475bc8 100644 --- a/web/src/api/models/InquiryStatus.ts +++ b/web/src/api/models/InquiryStatus.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ export enum InquiryStatus { PENDING = 'pending', RESPONDED = 'responded', diff --git a/web/src/api/models/InquirySummary.ts b/web/src/api/models/InquirySummary.ts index 43f59cb..f5678a5 100644 --- a/web/src/api/models/InquirySummary.ts +++ b/web/src/api/models/InquirySummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { InquiryStatus } from './InquiryStatus'; /** diff --git a/web/src/api/models/InstallPackRequest.ts b/web/src/api/models/InstallPackRequest.ts index 6de65ee..83729e7 100644 --- a/web/src/api/models/InstallPackRequest.ts +++ b/web/src/api/models/InstallPackRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Request DTO for installing a pack from remote source */ diff --git a/web/src/api/models/KeyResponse.ts b/web/src/api/models/KeyResponse.ts index de2cbb8..13dd204 100644 --- a/web/src/api/models/KeyResponse.ts +++ b/web/src/api/models/KeyResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { OwnerType } from './OwnerType'; /** @@ -57,8 +57,8 @@ export type KeyResponse = { */ updated: string; /** - * The secret value (decrypted if encrypted) + * The secret value (decrypted if encrypted). Can be a string, object, array, number, or boolean. */ - value: string; + value: any; }; diff --git a/web/src/api/models/KeySummary.ts b/web/src/api/models/KeySummary.ts index 9fbe25a..689b525 100644 --- a/web/src/api/models/KeySummary.ts +++ b/web/src/api/models/KeySummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { OwnerType } from './OwnerType'; /** diff --git a/web/src/api/models/LoginRequest.ts b/web/src/api/models/LoginRequest.ts index be1a08e..5db7ae2 100644 --- a/web/src/api/models/LoginRequest.ts +++ b/web/src/api/models/LoginRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Login request */ diff --git a/web/src/api/models/NullableJsonPatch.ts b/web/src/api/models/NullableJsonPatch.ts new file mode 100644 index 0000000..b3477ae --- /dev/null +++ b/web/src/api/models/NullableJsonPatch.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Value } from './Value'; +/** + * Explicit patch operation for nullable JSON fields. + */ +export type NullableJsonPatch = ({ + op: NullableJsonPatch.op; + value: Value; +} | { + op: NullableJsonPatch.op; +}); +export namespace NullableJsonPatch { + export enum op { + SET = 'set', + } +} + diff --git a/web/src/api/models/NullableStringPatch.ts b/web/src/api/models/NullableStringPatch.ts new file mode 100644 index 0000000..2d763e4 --- /dev/null +++ b/web/src/api/models/NullableStringPatch.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Explicit patch operation for nullable string fields. + */ +export type NullableStringPatch = ({ + op: NullableStringPatch.op; + value: string; +} | { + op: NullableStringPatch.op; +}); +export namespace NullableStringPatch { + export enum op { + SET = 'set', + } +} + diff --git a/web/src/api/models/OwnerType.ts b/web/src/api/models/OwnerType.ts index ab88d2b..c3ad5cd 100644 --- a/web/src/api/models/OwnerType.ts +++ b/web/src/api/models/OwnerType.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ export enum OwnerType { SYSTEM = 'system', IDENTITY = 'identity', diff --git a/web/src/api/models/PackInstallResponse.ts b/web/src/api/models/PackInstallResponse.ts index 70af751..186c204 100644 --- a/web/src/api/models/PackInstallResponse.ts +++ b/web/src/api/models/PackInstallResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { PackResponse } from './PackResponse'; import type { PackTestResult } from './PackTestResult'; /** diff --git a/web/src/api/models/PackSummary.ts b/web/src/api/models/PackSummary.ts index 80ca267..bd18e03 100644 --- a/web/src/api/models/PackSummary.ts +++ b/web/src/api/models/PackSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Simplified pack response (for list endpoints) */ diff --git a/web/src/api/models/PackTestExecution.ts b/web/src/api/models/PackTestExecution.ts index 3aae18c..d292713 100644 --- a/web/src/api/models/PackTestExecution.ts +++ b/web/src/api/models/PackTestExecution.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { Value } from './Value'; /** diff --git a/web/src/api/models/PackTestResult.ts b/web/src/api/models/PackTestResult.ts index 87bdba9..0680f10 100644 --- a/web/src/api/models/PackTestResult.ts +++ b/web/src/api/models/PackTestResult.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { TestSuiteResult } from './TestSuiteResult'; /** * Pack test result structure (not from DB, used for test execution) diff --git a/web/src/api/models/PackTestSummary.ts b/web/src/api/models/PackTestSummary.ts index 33a1bbd..58e5a4b 100644 --- a/web/src/api/models/PackTestSummary.ts +++ b/web/src/api/models/PackTestSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; /** * Pack test summary view diff --git a/web/src/api/models/PackWorkflowSyncResponse.ts b/web/src/api/models/PackWorkflowSyncResponse.ts index 93bcebb..c346da1 100644 --- a/web/src/api/models/PackWorkflowSyncResponse.ts +++ b/web/src/api/models/PackWorkflowSyncResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { WorkflowSyncResult } from './WorkflowSyncResult'; /** * Response for pack workflow sync operation diff --git a/web/src/api/models/PackWorkflowValidationResponse.ts b/web/src/api/models/PackWorkflowValidationResponse.ts index 5ebe21e..883e946 100644 --- a/web/src/api/models/PackWorkflowValidationResponse.ts +++ b/web/src/api/models/PackWorkflowValidationResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Response for pack workflow validation operation */ diff --git a/web/src/api/models/PaginatedResponse_ActionSummary.ts b/web/src/api/models/PaginatedResponse_ActionSummary.ts index 666ba63..4bcdb32 100644 --- a/web/src/api/models/PaginatedResponse_ActionSummary.ts +++ b/web/src/api/models/PaginatedResponse_ActionSummary.ts @@ -1,63 +1,64 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - -import type { PaginationMeta } from "./PaginationMeta"; +/* eslint-disable */ +import type { PaginationMeta } from './PaginationMeta'; /** * Paginated response wrapper */ export type PaginatedResponse_ActionSummary = { - /** - * The data items - */ - data: Array<{ /** - * Creation timestamp + * The data items */ - created: string; + data: Array<{ + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Human-readable label + */ + label: string; + /** + * Pack reference + */ + pack_ref: string; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; + }>; /** - * Action description + * Pagination metadata */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Human-readable label - */ - label: string; - /** - * Pack reference - */ - pack_ref: string; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; - }>; - /** - * Pagination metadata - */ - pagination: PaginationMeta; + pagination: PaginationMeta; }; + diff --git a/web/src/api/models/PaginatedResponse_EnforcementSummary.ts b/web/src/api/models/PaginatedResponse_EnforcementSummary.ts index 6d7f8c6..a7634e7 100644 --- a/web/src/api/models/PaginatedResponse_EnforcementSummary.ts +++ b/web/src/api/models/PaginatedResponse_EnforcementSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { EnforcementCondition } from './EnforcementCondition'; import type { EnforcementStatus } from './EnforcementStatus'; import type { i64 } from './i64'; diff --git a/web/src/api/models/PaginatedResponse_EventSummary.ts b/web/src/api/models/PaginatedResponse_EventSummary.ts index 5bf8e0e..4880c2f 100644 --- a/web/src/api/models/PaginatedResponse_EventSummary.ts +++ b/web/src/api/models/PaginatedResponse_EventSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { PaginationMeta } from './PaginationMeta'; /** diff --git a/web/src/api/models/PaginatedResponse_ExecutionSummary.ts b/web/src/api/models/PaginatedResponse_ExecutionSummary.ts index 9c874df..49fb7e7 100644 --- a/web/src/api/models/PaginatedResponse_ExecutionSummary.ts +++ b/web/src/api/models/PaginatedResponse_ExecutionSummary.ts @@ -1,78 +1,66 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - -import type { ExecutionStatus } from "./ExecutionStatus"; -import type { PaginationMeta } from "./PaginationMeta"; +/* eslint-disable */ +import type { ExecutionStatus } from './ExecutionStatus'; +import type { PaginationMeta } from './PaginationMeta'; /** * Paginated response wrapper */ export type PaginatedResponse_ExecutionSummary = { - /** - * The data items - */ - data: Array<{ /** - * Action reference + * The data items */ - action_ref: string; + data: Array<{ + /** + * Action reference + */ + action_ref: string; + /** + * Creation timestamp + */ + created: string; + /** + * Enforcement ID + */ + enforcement?: number | null; + /** + * Execution ID + */ + id: number; + /** + * Parent execution ID + */ + parent?: number | null; + /** + * Rule reference (if triggered by a rule) + */ + rule_ref?: string | null; + /** + * When the execution actually started running (worker picked it up). + * Null if the execution hasn't started running yet. + */ + started_at?: string | null; + /** + * Execution status + */ + status: ExecutionStatus; + /** + * Trigger reference (if triggered by a trigger) + */ + trigger_ref?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow task metadata (only populated for workflow task executions) + */ + workflow_task?: any | null; + }>; /** - * Creation timestamp + * Pagination metadata */ - created: string; - /** - * Enforcement ID - */ - enforcement?: number | null; - /** - * Execution ID - */ - id: number; - /** - * Parent execution ID - */ - parent?: number | null; - /** - * Rule reference (if triggered by a rule) - */ - rule_ref?: string | null; - /** - * Execution status - */ - status: ExecutionStatus; - /** - * When the execution actually started running (worker picked it up). - * Null if the execution hasn't started running yet. - */ - started_at?: string | null; - /** - * Trigger reference (if triggered by a trigger) - */ - trigger_ref?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow task metadata (only populated for workflow task executions) - */ - workflow_task?: { - workflow_execution: number; - task_name: string; - task_index?: number | null; - task_batch?: number | null; - retry_count: number; - max_retries: number; - next_retry_at?: string | null; - timeout_seconds?: number | null; - timed_out: boolean; - duration_ms?: number | null; - started_at?: string | null; - completed_at?: string | null; - } | null; - }>; - /** - * Pagination metadata - */ - pagination: PaginationMeta; + pagination: PaginationMeta; }; + diff --git a/web/src/api/models/PaginatedResponse_IdentitySummary.ts b/web/src/api/models/PaginatedResponse_IdentitySummary.ts new file mode 100644 index 0000000..0968f8c --- /dev/null +++ b/web/src/api/models/PaginatedResponse_IdentitySummary.ts @@ -0,0 +1,25 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PaginationMeta } from './PaginationMeta'; +import type { Value } from './Value'; +/** + * Paginated response wrapper + */ +export type PaginatedResponse_IdentitySummary = { + /** + * The data items + */ + data: Array<{ + attributes: Value; + display_name?: string | null; + id: number; + login: string; + }>; + /** + * Pagination metadata + */ + pagination: PaginationMeta; +}; + diff --git a/web/src/api/models/PaginatedResponse_InquirySummary.ts b/web/src/api/models/PaginatedResponse_InquirySummary.ts index cdb71bd..45bf350 100644 --- a/web/src/api/models/PaginatedResponse_InquirySummary.ts +++ b/web/src/api/models/PaginatedResponse_InquirySummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { InquiryStatus } from './InquiryStatus'; import type { PaginationMeta } from './PaginationMeta'; diff --git a/web/src/api/models/PaginatedResponse_KeySummary.ts b/web/src/api/models/PaginatedResponse_KeySummary.ts index fe32449..70945c9 100644 --- a/web/src/api/models/PaginatedResponse_KeySummary.ts +++ b/web/src/api/models/PaginatedResponse_KeySummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { OwnerType } from './OwnerType'; import type { PaginationMeta } from './PaginationMeta'; diff --git a/web/src/api/models/PaginatedResponse_PackSummary.ts b/web/src/api/models/PaginatedResponse_PackSummary.ts index 1340770..032f009 100644 --- a/web/src/api/models/PaginatedResponse_PackSummary.ts +++ b/web/src/api/models/PaginatedResponse_PackSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { PaginationMeta } from './PaginationMeta'; /** * Paginated response wrapper diff --git a/web/src/api/models/PaginatedResponse_PackTestSummary.ts b/web/src/api/models/PaginatedResponse_PackTestSummary.ts index 30635c3..aa5806f 100644 --- a/web/src/api/models/PaginatedResponse_PackTestSummary.ts +++ b/web/src/api/models/PaginatedResponse_PackTestSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { i64 } from './i64'; import type { PaginationMeta } from './PaginationMeta'; /** diff --git a/web/src/api/models/PaginatedResponse_RuntimeSummary.ts b/web/src/api/models/PaginatedResponse_RuntimeSummary.ts new file mode 100644 index 0000000..51b5af1 --- /dev/null +++ b/web/src/api/models/PaginatedResponse_RuntimeSummary.ts @@ -0,0 +1,27 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PaginationMeta } from './PaginationMeta'; +/** + * Paginated response wrapper + */ +export type PaginatedResponse_RuntimeSummary = { + /** + * The data items + */ + data: Array<{ + created: string; + description?: string | null; + id: number; + name: string; + pack_ref?: string | null; + ref: string; + updated: string; + }>; + /** + * Pagination metadata + */ + pagination: PaginationMeta; +}; + diff --git a/web/src/api/models/PaginatedResponse_SensorSummary.ts b/web/src/api/models/PaginatedResponse_SensorSummary.ts index 6dc50a4..ff69804 100644 --- a/web/src/api/models/PaginatedResponse_SensorSummary.ts +++ b/web/src/api/models/PaginatedResponse_SensorSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { PaginationMeta } from './PaginationMeta'; /** * Paginated response wrapper diff --git a/web/src/api/models/PaginatedResponse_TriggerSummary.ts b/web/src/api/models/PaginatedResponse_TriggerSummary.ts index b410e71..0690a9a 100644 --- a/web/src/api/models/PaginatedResponse_TriggerSummary.ts +++ b/web/src/api/models/PaginatedResponse_TriggerSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { PaginationMeta } from './PaginationMeta'; /** * Paginated response wrapper diff --git a/web/src/api/models/PaginatedResponse_WorkflowSummary.ts b/web/src/api/models/PaginatedResponse_WorkflowSummary.ts index f8c4934..bd5a712 100644 --- a/web/src/api/models/PaginatedResponse_WorkflowSummary.ts +++ b/web/src/api/models/PaginatedResponse_WorkflowSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { PaginationMeta } from './PaginationMeta'; /** * Paginated response wrapper @@ -53,3 +53,4 @@ export type PaginatedResponse_WorkflowSummary = { */ pagination: PaginationMeta; }; + diff --git a/web/src/api/models/PaginationMeta.ts b/web/src/api/models/PaginationMeta.ts index b5595b6..bc08279 100644 --- a/web/src/api/models/PaginationMeta.ts +++ b/web/src/api/models/PaginationMeta.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Pagination metadata */ diff --git a/web/src/api/models/PermissionAssignmentResponse.ts b/web/src/api/models/PermissionAssignmentResponse.ts new file mode 100644 index 0000000..f99cd1d --- /dev/null +++ b/web/src/api/models/PermissionAssignmentResponse.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PermissionAssignmentResponse = { + created: string; + id: number; + identity_id: number; + permission_set_id: number; + permission_set_ref: string; +}; + diff --git a/web/src/api/models/PermissionSetSummary.ts b/web/src/api/models/PermissionSetSummary.ts new file mode 100644 index 0000000..78ef4eb --- /dev/null +++ b/web/src/api/models/PermissionSetSummary.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Value } from './Value'; +export type PermissionSetSummary = { + description?: string | null; + grants: Value; + id: number; + label?: string | null; + pack_ref?: string | null; + ref: string; +}; + diff --git a/web/src/api/models/QueueStatsResponse.ts b/web/src/api/models/QueueStatsResponse.ts index b642cdd..9c616a0 100644 --- a/web/src/api/models/QueueStatsResponse.ts +++ b/web/src/api/models/QueueStatsResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Response DTO for queue statistics */ diff --git a/web/src/api/models/RefreshTokenRequest.ts b/web/src/api/models/RefreshTokenRequest.ts index 5302b60..d8d2c5c 100644 --- a/web/src/api/models/RefreshTokenRequest.ts +++ b/web/src/api/models/RefreshTokenRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Refresh token request */ diff --git a/web/src/api/models/RegisterPackRequest.ts b/web/src/api/models/RegisterPackRequest.ts index 549ee38..c561364 100644 --- a/web/src/api/models/RegisterPackRequest.ts +++ b/web/src/api/models/RegisterPackRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Request DTO for registering a pack from local filesystem */ diff --git a/web/src/api/models/RegisterRequest.ts b/web/src/api/models/RegisterRequest.ts index b9931d3..ec5e176 100644 --- a/web/src/api/models/RegisterRequest.ts +++ b/web/src/api/models/RegisterRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Register request */ diff --git a/web/src/api/models/RuntimeResponse.ts b/web/src/api/models/RuntimeResponse.ts new file mode 100644 index 0000000..b2c4d66 --- /dev/null +++ b/web/src/api/models/RuntimeResponse.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Full runtime response. + */ +export type RuntimeResponse = { + created: string; + description?: string | null; + distributions: Record; + execution_config: Record; + id: number; + installation: any | null; + name: string; + pack?: number | null; + pack_ref?: string | null; + ref: string; + updated: string; +}; + diff --git a/web/src/api/models/RuntimeSummary.ts b/web/src/api/models/RuntimeSummary.ts new file mode 100644 index 0000000..b381270 --- /dev/null +++ b/web/src/api/models/RuntimeSummary.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * Runtime summary for list views. + */ +export type RuntimeSummary = { + created: string; + description?: string | null; + id: number; + name: string; + pack_ref?: string | null; + ref: string; + updated: string; +}; + diff --git a/web/src/api/models/SensorSummary.ts b/web/src/api/models/SensorSummary.ts index 5b734ea..05cdd53 100644 --- a/web/src/api/models/SensorSummary.ts +++ b/web/src/api/models/SensorSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Simplified sensor response (for list endpoints) */ diff --git a/web/src/api/models/SuccessResponse.ts b/web/src/api/models/SuccessResponse.ts index 73a478a..24948a8 100644 --- a/web/src/api/models/SuccessResponse.ts +++ b/web/src/api/models/SuccessResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Success message response (for operations that don't return data) */ diff --git a/web/src/api/models/TestCaseResult.ts b/web/src/api/models/TestCaseResult.ts index 5000377..42d1bc5 100644 --- a/web/src/api/models/TestCaseResult.ts +++ b/web/src/api/models/TestCaseResult.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { TestStatus } from './TestStatus'; /** * Individual test case result diff --git a/web/src/api/models/TestStatus.ts b/web/src/api/models/TestStatus.ts index 71ca37f..3f8ed79 100644 --- a/web/src/api/models/TestStatus.ts +++ b/web/src/api/models/TestStatus.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Test status enum */ diff --git a/web/src/api/models/TestSuiteResult.ts b/web/src/api/models/TestSuiteResult.ts index 4ec0223..ada7ef3 100644 --- a/web/src/api/models/TestSuiteResult.ts +++ b/web/src/api/models/TestSuiteResult.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { TestCaseResult } from './TestCaseResult'; /** * Test suite result (collection of test cases) diff --git a/web/src/api/models/TokenResponse.ts b/web/src/api/models/TokenResponse.ts index 3424984..89f3695 100644 --- a/web/src/api/models/TokenResponse.ts +++ b/web/src/api/models/TokenResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { UserInfo } from './UserInfo'; /** * Token response diff --git a/web/src/api/models/TriggerSummary.ts b/web/src/api/models/TriggerSummary.ts index 3fbb9f7..d5a68ad 100644 --- a/web/src/api/models/TriggerSummary.ts +++ b/web/src/api/models/TriggerSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Simplified trigger response (for list endpoints) */ diff --git a/web/src/api/models/UpdateIdentityRequest.ts b/web/src/api/models/UpdateIdentityRequest.ts new file mode 100644 index 0000000..1e946b9 --- /dev/null +++ b/web/src/api/models/UpdateIdentityRequest.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Value } from './Value'; +export type UpdateIdentityRequest = { + attributes?: (null | Value); + display_name?: string | null; + password?: string | null; +}; + diff --git a/web/src/api/models/UpdateKeyRequest.ts b/web/src/api/models/UpdateKeyRequest.ts index a6153b3..c8678b2 100644 --- a/web/src/api/models/UpdateKeyRequest.ts +++ b/web/src/api/models/UpdateKeyRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Request to update an existing key/secret */ @@ -15,8 +15,8 @@ export type UpdateKeyRequest = { */ name?: string | null; /** - * Update the secret value + * Update the secret value. Can be a string, object, array, number, or boolean. */ - value?: string | null; + value?: any; }; diff --git a/web/src/api/models/UpdateRuntimeRequest.ts b/web/src/api/models/UpdateRuntimeRequest.ts new file mode 100644 index 0000000..1a56946 --- /dev/null +++ b/web/src/api/models/UpdateRuntimeRequest.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { NullableJsonPatch } from './NullableJsonPatch'; +import type { NullableStringPatch } from './NullableStringPatch'; +/** + * Request DTO for updating a runtime. + */ +export type UpdateRuntimeRequest = { + description?: (null | NullableStringPatch); + /** + * Distribution metadata used for verification and platform support + */ + distributions: any | null; + /** + * Runtime execution configuration + */ + execution_config: any | null; + installation?: (null | NullableJsonPatch); + /** + * Display name + */ + name?: string | null; +}; + diff --git a/web/src/api/models/UpdateWorkflowRequest.ts b/web/src/api/models/UpdateWorkflowRequest.ts index c984cdf..e9021ea 100644 --- a/web/src/api/models/UpdateWorkflowRequest.ts +++ b/web/src/api/models/UpdateWorkflowRequest.ts @@ -35,3 +35,4 @@ export type UpdateWorkflowRequest = { */ version?: string | null; }; + diff --git a/web/src/api/models/UserInfo.ts b/web/src/api/models/UserInfo.ts index 7bb92b5..671ba2a 100644 --- a/web/src/api/models/UserInfo.ts +++ b/web/src/api/models/UserInfo.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * User information included in token response */ diff --git a/web/src/api/models/WebhookReceiverRequest.ts b/web/src/api/models/WebhookReceiverRequest.ts index 7f805c0..a06c696 100644 --- a/web/src/api/models/WebhookReceiverRequest.ts +++ b/web/src/api/models/WebhookReceiverRequest.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { Value } from './Value'; /** * Request body for webhook receiver endpoint diff --git a/web/src/api/models/WebhookReceiverResponse.ts b/web/src/api/models/WebhookReceiverResponse.ts index 0d33d4a..2e4e74c 100644 --- a/web/src/api/models/WebhookReceiverResponse.ts +++ b/web/src/api/models/WebhookReceiverResponse.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Response from webhook receiver endpoint */ diff --git a/web/src/api/models/WorkflowResponse.ts b/web/src/api/models/WorkflowResponse.ts index 6e784ac..cf4b874 100644 --- a/web/src/api/models/WorkflowResponse.ts +++ b/web/src/api/models/WorkflowResponse.ts @@ -59,3 +59,4 @@ export type WorkflowResponse = { */ version: string; }; + diff --git a/web/src/api/models/WorkflowSummary.ts b/web/src/api/models/WorkflowSummary.ts index 17e7cfb..c7269e2 100644 --- a/web/src/api/models/WorkflowSummary.ts +++ b/web/src/api/models/WorkflowSummary.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Simplified workflow response (for list endpoints) */ @@ -43,3 +43,4 @@ export type WorkflowSummary = { */ version: string; }; + diff --git a/web/src/api/models/WorkflowSyncResult.ts b/web/src/api/models/WorkflowSyncResult.ts index 5fae670..38da9a7 100644 --- a/web/src/api/models/WorkflowSyncResult.ts +++ b/web/src/api/models/WorkflowSyncResult.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ /** * Individual workflow sync result */ diff --git a/web/src/api/models/i64.ts b/web/src/api/models/i64.ts index a63f3b7..6129ad9 100644 --- a/web/src/api/models/i64.ts +++ b/web/src/api/models/i64.ts @@ -1,5 +1,5 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ export type i64 = number; diff --git a/web/src/api/services/ActionsService.ts b/web/src/api/services/ActionsService.ts index 926868b..8b02a4b 100644 --- a/web/src/api/services/ActionsService.ts +++ b/web/src/api/services/ActionsService.ts @@ -2,456 +2,456 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { CreateActionRequest } from "../models/CreateActionRequest"; -import type { PaginatedResponse_ActionSummary } from "../models/PaginatedResponse_ActionSummary"; -import type { SuccessResponse } from "../models/SuccessResponse"; -import type { UpdateActionRequest } from "../models/UpdateActionRequest"; -import type { CancelablePromise } from "../core/CancelablePromise"; -import { OpenAPI } from "../core/OpenAPI"; -import { request as __request } from "../core/request"; +import type { CreateActionRequest } from '../models/CreateActionRequest'; +import type { PaginatedResponse_ActionSummary } from '../models/PaginatedResponse_ActionSummary'; +import type { SuccessResponse } from '../models/SuccessResponse'; +import type { UpdateActionRequest } from '../models/UpdateActionRequest'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; export class ActionsService { - /** - * List all actions with pagination - * @returns PaginatedResponse_ActionSummary List of actions - * @throws ApiError - */ - public static listActions({ - page, - pageSize, - }: { /** - * Page number (1-based) + * List all actions with pagination + * @returns PaginatedResponse_ActionSummary List of actions + * @throws ApiError */ - page?: number; + public static listActions({ + page, + pageSize, + }: { + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/actions', + query: { + 'page': page, + 'page_size': pageSize, + }, + }); + } /** - * Number of items per page + * Create a new action + * @returns any Action created successfully + * @throws ApiError */ - pageSize?: number; - }): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/actions", - query: { - page: page, - page_size: pageSize, - }, - }); - } - /** - * Create a new action - * @returns any Action created successfully - * @throws ApiError - */ - public static createAction({ - requestBody, - }: { - requestBody: CreateActionRequest; - }): CancelablePromise<{ + public static createAction({ + requestBody, + }: { + requestBody: CreateActionRequest, + }): CancelablePromise<{ + /** + * Response DTO for action information + */ + data: { + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Whether this is an ad-hoc action (not from pack installation) + */ + is_adhoc: boolean; + /** + * Human-readable label + */ + label: string; + /** + * Output schema + */ + out_schema: any | null; + /** + * Pack ID + */ + pack: number; + /** + * Pack reference + */ + pack_ref: string; + /** + * Parameter schema (StackStorm-style with inline required/secret) + */ + param_schema: any | null; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/actions', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Validation error`, + 404: `Pack not found`, + 409: `Action with same ref already exists`, + }, + }); + } /** - * Response DTO for action information + * Get a single action by reference + * @returns any Action details + * @throws ApiError */ - data: { - /** - * Creation timestamp - */ - created: string; - /** - * Action description - */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Whether this is an ad-hoc action (not from pack installation) - */ - is_adhoc: boolean; - /** - * Human-readable label - */ - label: string; - /** - * Output schema - */ - out_schema: any | null; - /** - * Pack ID - */ - pack: number; - /** - * Pack reference - */ - pack_ref: string; - /** - * Parameter schema (StackStorm-style with inline required/secret) - */ - param_schema: any | null; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; - }; + public static getAction({ + ref, + }: { + /** + * Action reference identifier + */ + ref: string, + }): CancelablePromise<{ + /** + * Response DTO for action information + */ + data: { + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Whether this is an ad-hoc action (not from pack installation) + */ + is_adhoc: boolean; + /** + * Human-readable label + */ + label: string; + /** + * Output schema + */ + out_schema: any | null; + /** + * Pack ID + */ + pack: number; + /** + * Pack reference + */ + pack_ref: string; + /** + * Parameter schema (StackStorm-style with inline required/secret) + */ + param_schema: any | null; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/actions/{ref}', + path: { + 'ref': ref, + }, + errors: { + 404: `Action not found`, + }, + }); + } /** - * Optional message + * Update an existing action + * @returns any Action updated successfully + * @throws ApiError */ - message?: string | null; - }> { - return __request(OpenAPI, { - method: "POST", - url: "/api/v1/actions", - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Validation error`, - 404: `Pack not found`, - 409: `Action with same ref already exists`, - }, - }); - } - /** - * Get a single action by reference - * @returns any Action details - * @throws ApiError - */ - public static getAction({ - ref, - }: { + public static updateAction({ + ref, + requestBody, + }: { + /** + * Action reference identifier + */ + ref: string, + requestBody: UpdateActionRequest, + }): CancelablePromise<{ + /** + * Response DTO for action information + */ + data: { + /** + * Creation timestamp + */ + created: string; + /** + * Action description + */ + description: string; + /** + * Entry point + */ + entrypoint: string; + /** + * Action ID + */ + id: number; + /** + * Whether this is an ad-hoc action (not from pack installation) + */ + is_adhoc: boolean; + /** + * Human-readable label + */ + label: string; + /** + * Output schema + */ + out_schema: any | null; + /** + * Pack ID + */ + pack: number; + /** + * Pack reference + */ + pack_ref: string; + /** + * Parameter schema (StackStorm-style with inline required/secret) + */ + param_schema: any | null; + /** + * Unique reference identifier + */ + ref: string; + /** + * Runtime ID + */ + runtime?: number | null; + /** + * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") + */ + runtime_version_constraint?: string | null; + /** + * Last update timestamp + */ + updated: string; + /** + * Workflow definition ID (non-null if this action is a workflow) + */ + workflow_def?: number | null; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v1/actions/{ref}', + path: { + 'ref': ref, + }, + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Validation error`, + 404: `Action not found`, + }, + }); + } /** - * Action reference identifier + * Delete an action + * @returns SuccessResponse Action deleted successfully + * @throws ApiError */ - ref: string; - }): CancelablePromise<{ + public static deleteAction({ + ref, + }: { + /** + * Action reference identifier + */ + ref: string, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/actions/{ref}', + path: { + 'ref': ref, + }, + errors: { + 404: `Action not found`, + }, + }); + } /** - * Response DTO for action information + * Get queue statistics for an action + * @returns any Queue statistics + * @throws ApiError */ - data: { - /** - * Creation timestamp - */ - created: string; - /** - * Action description - */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Whether this is an ad-hoc action (not from pack installation) - */ - is_adhoc: boolean; - /** - * Human-readable label - */ - label: string; - /** - * Output schema - */ - out_schema: any | null; - /** - * Pack ID - */ - pack: number; - /** - * Pack reference - */ - pack_ref: string; - /** - * Parameter schema (StackStorm-style with inline required/secret) - */ - param_schema: any | null; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; - }; + public static getQueueStats({ + ref, + }: { + /** + * Action reference identifier + */ + ref: string, + }): CancelablePromise<{ + /** + * Response DTO for queue statistics + */ + data: { + /** + * Action ID + */ + action_id: number; + /** + * Action reference + */ + action_ref: string; + /** + * Number of currently running executions + */ + active_count: number; + /** + * Timestamp of last statistics update + */ + last_updated: string; + /** + * Maximum concurrent executions allowed + */ + max_concurrent: number; + /** + * Timestamp of oldest queued execution (if any) + */ + oldest_enqueued_at?: string | null; + /** + * Number of executions waiting in queue + */ + queue_length: number; + /** + * Total executions completed since queue creation + */ + total_completed: number; + /** + * Total executions enqueued since queue creation + */ + total_enqueued: number; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/actions/{ref}/queue-stats', + path: { + 'ref': ref, + }, + errors: { + 404: `Action not found or no queue statistics available`, + }, + }); + } /** - * Optional message + * List actions by pack reference + * @returns PaginatedResponse_ActionSummary List of actions for pack + * @throws ApiError */ - message?: string | null; - }> { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/actions/{ref}", - path: { - ref: ref, - }, - errors: { - 404: `Action not found`, - }, - }); - } - /** - * Update an existing action - * @returns any Action updated successfully - * @throws ApiError - */ - public static updateAction({ - ref, - requestBody, - }: { - /** - * Action reference identifier - */ - ref: string; - requestBody: UpdateActionRequest; - }): CancelablePromise<{ - /** - * Response DTO for action information - */ - data: { - /** - * Creation timestamp - */ - created: string; - /** - * Action description - */ - description: string; - /** - * Entry point - */ - entrypoint: string; - /** - * Action ID - */ - id: number; - /** - * Whether this is an ad-hoc action (not from pack installation) - */ - is_adhoc: boolean; - /** - * Human-readable label - */ - label: string; - /** - * Output schema - */ - out_schema: any | null; - /** - * Pack ID - */ - pack: number; - /** - * Pack reference - */ - pack_ref: string; - /** - * Parameter schema (StackStorm-style with inline required/secret) - */ - param_schema: any | null; - /** - * Unique reference identifier - */ - ref: string; - /** - * Runtime ID - */ - runtime?: number | null; - /** - * Semver version constraint for the runtime (e.g., ">=3.12", ">=3.12,<4.0", "~18.0") - */ - runtime_version_constraint?: string | null; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow definition ID (non-null if this action is a workflow) - */ - workflow_def?: number | null; - }; - /** - * Optional message - */ - message?: string | null; - }> { - return __request(OpenAPI, { - method: "PUT", - url: "/api/v1/actions/{ref}", - path: { - ref: ref, - }, - body: requestBody, - mediaType: "application/json", - errors: { - 400: `Validation error`, - 404: `Action not found`, - }, - }); - } - /** - * Delete an action - * @returns SuccessResponse Action deleted successfully - * @throws ApiError - */ - public static deleteAction({ - ref, - }: { - /** - * Action reference identifier - */ - ref: string; - }): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", - url: "/api/v1/actions/{ref}", - path: { - ref: ref, - }, - errors: { - 404: `Action not found`, - }, - }); - } - /** - * Get queue statistics for an action - * @returns any Queue statistics - * @throws ApiError - */ - public static getQueueStats({ - ref, - }: { - /** - * Action reference identifier - */ - ref: string; - }): CancelablePromise<{ - /** - * Response DTO for queue statistics - */ - data: { - /** - * Action ID - */ - action_id: number; - /** - * Action reference - */ - action_ref: string; - /** - * Number of currently running executions - */ - active_count: number; - /** - * Timestamp of last statistics update - */ - last_updated: string; - /** - * Maximum concurrent executions allowed - */ - max_concurrent: number; - /** - * Timestamp of oldest queued execution (if any) - */ - oldest_enqueued_at?: string | null; - /** - * Number of executions waiting in queue - */ - queue_length: number; - /** - * Total executions completed since queue creation - */ - total_completed: number; - /** - * Total executions enqueued since queue creation - */ - total_enqueued: number; - }; - /** - * Optional message - */ - message?: string | null; - }> { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/actions/{ref}/queue-stats", - path: { - ref: ref, - }, - errors: { - 404: `Action not found or no queue statistics available`, - }, - }); - } - /** - * List actions by pack reference - * @returns PaginatedResponse_ActionSummary List of actions for pack - * @throws ApiError - */ - public static listActionsByPack({ - packRef, - page, - pageSize, - }: { - /** - * Pack reference identifier - */ - packRef: string; - /** - * Page number (1-based) - */ - page?: number; - /** - * Number of items per page - */ - pageSize?: number; - }): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/packs/{pack_ref}/actions", - path: { - pack_ref: packRef, - }, - query: { - page: page, - page_size: pageSize, - }, - errors: { - 404: `Pack not found`, - }, - }); - } + public static listActionsByPack({ + packRef, + page, + pageSize, + }: { + /** + * Pack reference identifier + */ + packRef: string, + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/packs/{pack_ref}/actions', + path: { + 'pack_ref': packRef, + }, + query: { + 'page': page, + 'page_size': pageSize, + }, + errors: { + 404: `Pack not found`, + }, + }); + } } diff --git a/web/src/api/services/AuthService.ts b/web/src/api/services/AuthService.ts index 78ef880..f3b029a 100644 --- a/web/src/api/services/AuthService.ts +++ b/web/src/api/services/AuthService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ChangePasswordRequest } from '../models/ChangePasswordRequest'; import type { LoginRequest } from '../models/LoginRequest'; import type { RefreshTokenRequest } from '../models/RefreshTokenRequest'; diff --git a/web/src/api/services/EnforcementsService.ts b/web/src/api/services/EnforcementsService.ts index 42948de..9ae0e81 100644 --- a/web/src/api/services/EnforcementsService.ts +++ b/web/src/api/services/EnforcementsService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ApiResponse_EnforcementResponse } from '../models/ApiResponse_EnforcementResponse'; import type { EnforcementStatus } from '../models/EnforcementStatus'; import type { i64 } from '../models/i64'; @@ -20,6 +20,7 @@ export class EnforcementsService { event, status, triggerRef, + ruleRef, page, perPage, }: { @@ -39,6 +40,10 @@ export class EnforcementsService { * Filter by trigger reference */ triggerRef?: string | null, + /** + * Filter by rule reference + */ + ruleRef?: string | null, /** * Page number (1-indexed) */ @@ -56,6 +61,7 @@ export class EnforcementsService { 'event': event, 'status': status, 'trigger_ref': triggerRef, + 'rule_ref': ruleRef, 'page': page, 'per_page': perPage, }, diff --git a/web/src/api/services/EventsService.ts b/web/src/api/services/EventsService.ts index edd2fa9..63e62c9 100644 --- a/web/src/api/services/EventsService.ts +++ b/web/src/api/services/EventsService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ApiResponse_EventResponse } from '../models/ApiResponse_EventResponse'; import type { i64 } from '../models/i64'; import type { PaginatedResponse_EventSummary } from '../models/PaginatedResponse_EventSummary'; diff --git a/web/src/api/services/ExecutionsService.ts b/web/src/api/services/ExecutionsService.ts index 7ff0f58..b65956c 100644 --- a/web/src/api/services/ExecutionsService.ts +++ b/web/src/api/services/ExecutionsService.ts @@ -2,292 +2,280 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ExecutionStatus } from "../models/ExecutionStatus"; -import type { PaginatedResponse_ExecutionSummary } from "../models/PaginatedResponse_ExecutionSummary"; -import type { CancelablePromise } from "../core/CancelablePromise"; -import { OpenAPI } from "../core/OpenAPI"; -import { request as __request } from "../core/request"; +import type { ExecutionStatus } from '../models/ExecutionStatus'; +import type { PaginatedResponse_ExecutionSummary } from '../models/PaginatedResponse_ExecutionSummary'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; export class ExecutionsService { - /** - * List all executions with pagination and optional filters - * @returns PaginatedResponse_ExecutionSummary List of executions - * @throws ApiError - */ - public static listExecutions({ - status, - actionRef, - packName, - ruleRef, - triggerRef, - executor, - resultContains, - enforcement, - parent, - topLevelOnly, - page, - perPage, - }: { /** - * Filter by execution status + * List all executions with pagination and optional filters + * @returns PaginatedResponse_ExecutionSummary List of executions + * @throws ApiError */ - status?: null | ExecutionStatus; + public static listExecutions({ + status, + actionRef, + packName, + ruleRef, + triggerRef, + executor, + resultContains, + enforcement, + parent, + topLevelOnly, + page, + perPage, + }: { + /** + * Filter by execution status + */ + status?: (null | ExecutionStatus), + /** + * Filter by action reference + */ + actionRef?: string | null, + /** + * Filter by pack name + */ + packName?: string | null, + /** + * Filter by rule reference + */ + ruleRef?: string | null, + /** + * Filter by trigger reference + */ + triggerRef?: string | null, + /** + * Filter by executor ID + */ + executor?: number | null, + /** + * Search in result JSON (case-insensitive substring match) + */ + resultContains?: string | null, + /** + * Filter by enforcement ID + */ + enforcement?: number | null, + /** + * Filter by parent execution ID + */ + parent?: number | null, + /** + * If true, only return top-level executions (those without a parent). + * Useful for the "By Workflow" view where child tasks are loaded separately. + */ + topLevelOnly?: boolean | null, + /** + * Page number (for pagination) + */ + page?: number, + /** + * Items per page (for pagination) + */ + perPage?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/executions', + query: { + 'status': status, + 'action_ref': actionRef, + 'pack_name': packName, + 'rule_ref': ruleRef, + 'trigger_ref': triggerRef, + 'executor': executor, + 'result_contains': resultContains, + 'enforcement': enforcement, + 'parent': parent, + 'top_level_only': topLevelOnly, + 'page': page, + 'per_page': perPage, + }, + }); + } /** - * Filter by action reference + * List executions by enforcement ID + * @returns PaginatedResponse_ExecutionSummary List of executions for enforcement + * @throws ApiError */ - actionRef?: string | null; + public static listExecutionsByEnforcement({ + enforcementId, + page, + pageSize, + }: { + /** + * Enforcement ID + */ + enforcementId: number, + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/executions/enforcement/{enforcement_id}', + path: { + 'enforcement_id': enforcementId, + }, + query: { + 'page': page, + 'page_size': pageSize, + }, + errors: { + 500: `Internal server error`, + }, + }); + } /** - * Filter by pack name + * Get execution statistics + * @returns any Execution statistics + * @throws ApiError */ - packName?: string | null; + public static getExecutionStats(): CancelablePromise> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/executions/stats', + errors: { + 500: `Internal server error`, + }, + }); + } /** - * Filter by rule reference + * List executions by status + * @returns PaginatedResponse_ExecutionSummary List of executions with specified status + * @throws ApiError */ - ruleRef?: string | null; + public static listExecutionsByStatus({ + status, + page, + pageSize, + }: { + /** + * Execution status (requested, scheduling, scheduled, running, completed, failed, canceling, cancelled, timeout, abandoned) + */ + status: string, + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/executions/status/{status}', + path: { + 'status': status, + }, + query: { + 'page': page, + 'page_size': pageSize, + }, + errors: { + 400: `Invalid status`, + 500: `Internal server error`, + }, + }); + } /** - * Filter by trigger reference + * Get a single execution by ID + * @returns any Execution details + * @throws ApiError */ - triggerRef?: string | null; - /** - * Filter by executor ID - */ - executor?: number | null; - /** - * Search in result JSON (case-insensitive substring match) - */ - resultContains?: string | null; - /** - * Filter by enforcement ID - */ - enforcement?: number | null; - /** - * Filter by parent execution ID - */ - parent?: number | null; - /** - * If true, only return top-level executions (those without a parent) - */ - topLevelOnly?: boolean | null; - /** - * Page number (for pagination) - */ - page?: number; - /** - * Items per page (for pagination) - */ - perPage?: number; - }): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/executions", - query: { - status: status, - action_ref: actionRef, - pack_name: packName, - rule_ref: ruleRef, - trigger_ref: triggerRef, - executor: executor, - result_contains: resultContains, - enforcement: enforcement, - parent: parent, - top_level_only: topLevelOnly, - page: page, - per_page: perPage, - }, - }); - } - /** - * List executions by enforcement ID - * @returns PaginatedResponse_ExecutionSummary List of executions for enforcement - * @throws ApiError - */ - public static listExecutionsByEnforcement({ - enforcementId, - page, - pageSize, - }: { - /** - * Enforcement ID - */ - enforcementId: number; - /** - * Page number (1-based) - */ - page?: number; - /** - * Number of items per page - */ - pageSize?: number; - }): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/executions/enforcement/{enforcement_id}", - path: { - enforcement_id: enforcementId, - }, - query: { - page: page, - page_size: pageSize, - }, - errors: { - 500: `Internal server error`, - }, - }); - } - /** - * Get execution statistics - * @returns any Execution statistics - * @throws ApiError - */ - public static getExecutionStats(): CancelablePromise> { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/executions/stats", - errors: { - 500: `Internal server error`, - }, - }); - } - /** - * List executions by status - * @returns PaginatedResponse_ExecutionSummary List of executions with specified status - * @throws ApiError - */ - public static listExecutionsByStatus({ - status, - page, - pageSize, - }: { - /** - * Execution status (requested, scheduling, scheduled, running, completed, failed, canceling, cancelled, timeout, abandoned) - */ - status: string; - /** - * Page number (1-based) - */ - page?: number; - /** - * Number of items per page - */ - pageSize?: number; - }): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/executions/status/{status}", - path: { - status: status, - }, - query: { - page: page, - page_size: pageSize, - }, - errors: { - 400: `Invalid status`, - 500: `Internal server error`, - }, - }); - } - /** - * Get a single execution by ID - * @returns any Execution details - * @throws ApiError - */ - public static getExecution({ - id, - }: { - /** - * Execution ID - */ - id: number; - }): CancelablePromise<{ - /** - * Response DTO for execution information - */ - data: { - /** - * Action ID (optional, may be null for ad-hoc executions) - */ - action?: number | null; - /** - * Action reference - */ - action_ref: string; - /** - * Execution configuration/parameters - */ - config: Record; - /** - * Creation timestamp - */ - created: string; - /** - * Enforcement ID (rule enforcement that triggered this) - */ - enforcement?: number | null; - /** - * Identity ID that initiated this execution - */ - executor?: number | null; - /** - * Execution ID - */ - id: number; - /** - * Parent execution ID (for nested/child executions) - */ - parent?: number | null; - /** - * Worker ID currently assigned to this execution - */ - worker?: number | null; - /** - * Execution result/output - */ - result: Record; - /** - * When the execution actually started running (worker picked it up). - * Null if the execution hasn't started running yet. - */ - started_at?: string | null; - /** - * Execution status - */ - status: ExecutionStatus; - /** - * Last update timestamp - */ - updated: string; - /** - * Workflow task metadata (only populated for workflow task executions) - */ - workflow_task?: { - workflow_execution: number; - task_name: string; - task_index?: number | null; - task_batch?: number | null; - retry_count: number; - max_retries: number; - next_retry_at?: string | null; - timeout_seconds?: number | null; - timed_out: boolean; - duration_ms?: number | null; - started_at?: string | null; - completed_at?: string | null; - } | null; - }; - /** - * Optional message - */ - message?: string | null; - }> { - return __request(OpenAPI, { - method: "GET", - url: "/api/v1/executions/{id}", - path: { - id: id, - }, - errors: { - 404: `Execution not found`, - }, - }); - } + public static getExecution({ + id, + }: { + /** + * Execution ID + */ + id: number, + }): CancelablePromise<{ + /** + * Response DTO for execution information + */ + data: { + /** + * Action ID (optional, may be null for ad-hoc executions) + */ + action?: number | null; + /** + * Action reference + */ + action_ref: string; + /** + * Execution configuration/parameters + */ + config: Record; + /** + * Creation timestamp + */ + created: string; + /** + * Enforcement ID (rule enforcement that triggered this) + */ + enforcement?: number | null; + /** + * Identity ID that initiated this execution + */ + executor?: number | null; + /** + * Execution ID + */ + id: number; + /** + * Parent execution ID (for nested/child executions) + */ + parent?: number | null; + /** + * Execution result/output + */ + result: Record; + /** + * When the execution actually started running (worker picked it up). + * Null if the execution hasn't started running yet. + */ + started_at?: string | null; + /** + * Execution status + */ + status: ExecutionStatus; + /** + * Last update timestamp + */ + updated: string; + /** + * Worker ID currently assigned to this execution + */ + worker?: number | null; + /** + * Workflow task metadata (only populated for workflow task executions) + */ + workflow_task?: any | null; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/executions/{id}', + path: { + 'id': id, + }, + errors: { + 404: `Execution not found`, + }, + }); + } } diff --git a/web/src/api/services/InquiriesService.ts b/web/src/api/services/InquiriesService.ts index 721ee83..5611f43 100644 --- a/web/src/api/services/InquiriesService.ts +++ b/web/src/api/services/InquiriesService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ApiResponse_InquiryResponse } from '../models/ApiResponse_InquiryResponse'; import type { CreateInquiryRequest } from '../models/CreateInquiryRequest'; import type { i64 } from '../models/i64'; diff --git a/web/src/api/services/PermissionsService.ts b/web/src/api/services/PermissionsService.ts new file mode 100644 index 0000000..09f4469 --- /dev/null +++ b/web/src/api/services/PermissionsService.ts @@ -0,0 +1,298 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CreateIdentityRequest } from '../models/CreateIdentityRequest'; +import type { CreatePermissionAssignmentRequest } from '../models/CreatePermissionAssignmentRequest'; +import type { PaginatedResponse_IdentitySummary } from '../models/PaginatedResponse_IdentitySummary'; +import type { PermissionAssignmentResponse } from '../models/PermissionAssignmentResponse'; +import type { PermissionSetSummary } from '../models/PermissionSetSummary'; +import type { UpdateIdentityRequest } from '../models/UpdateIdentityRequest'; +import type { Value } from '../models/Value'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class PermissionsService { + /** + * @returns PaginatedResponse_IdentitySummary List identities + * @throws ApiError + */ + public static listIdentities({ + page, + pageSize, + }: { + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/identities', + query: { + 'page': page, + 'page_size': pageSize, + }, + }); + } + /** + * @returns any Identity created + * @throws ApiError + */ + public static createIdentity({ + requestBody, + }: { + requestBody: CreateIdentityRequest, + }): CancelablePromise<{ + data: { + attributes: Value; + display_name?: string | null; + id: number; + login: string; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/identities', + body: requestBody, + mediaType: 'application/json', + errors: { + 409: `Identity already exists`, + }, + }); + } + /** + * @returns any Identity details + * @throws ApiError + */ + public static getIdentity({ + id, + }: { + /** + * Identity ID + */ + id: number, + }): CancelablePromise<{ + data: { + attributes: Value; + display_name?: string | null; + id: number; + login: string; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/identities/{id}', + path: { + 'id': id, + }, + errors: { + 404: `Identity not found`, + }, + }); + } + /** + * @returns any Identity updated + * @throws ApiError + */ + public static updateIdentity({ + id, + requestBody, + }: { + /** + * Identity ID + */ + id: number, + requestBody: UpdateIdentityRequest, + }): CancelablePromise<{ + data: { + attributes: Value; + display_name?: string | null; + id: number; + login: string; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v1/identities/{id}', + path: { + 'id': id, + }, + body: requestBody, + mediaType: 'application/json', + errors: { + 404: `Identity not found`, + }, + }); + } + /** + * @returns any Identity deleted + * @throws ApiError + */ + public static deleteIdentity({ + id, + }: { + /** + * Identity ID + */ + id: number, + }): CancelablePromise<{ + /** + * Success message response (for operations that don't return data) + */ + data: { + /** + * Message describing the operation + */ + message: string; + /** + * Success indicator + */ + success: boolean; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/identities/{id}', + path: { + 'id': id, + }, + errors: { + 404: `Identity not found`, + }, + }); + } + /** + * @returns PermissionAssignmentResponse List permission assignments for an identity + * @throws ApiError + */ + public static listIdentityPermissions({ + id, + }: { + /** + * Identity ID + */ + id: number, + }): CancelablePromise> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/identities/{id}/permissions', + path: { + 'id': id, + }, + errors: { + 404: `Identity not found`, + }, + }); + } + /** + * @returns any Permission assignment created + * @throws ApiError + */ + public static createPermissionAssignment({ + requestBody, + }: { + requestBody: CreatePermissionAssignmentRequest, + }): CancelablePromise<{ + data: { + created: string; + id: number; + identity_id: number; + permission_set_id: number; + permission_set_ref: string; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/permissions/assignments', + body: requestBody, + mediaType: 'application/json', + errors: { + 404: `Identity or permission set not found`, + 409: `Assignment already exists`, + }, + }); + } + /** + * @returns any Permission assignment deleted + * @throws ApiError + */ + public static deletePermissionAssignment({ + id, + }: { + /** + * Permission assignment ID + */ + id: number, + }): CancelablePromise<{ + /** + * Success message response (for operations that don't return data) + */ + data: { + /** + * Message describing the operation + */ + message: string; + /** + * Success indicator + */ + success: boolean; + }; + /** + * Optional message + */ + message?: string | null; + }> { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/permissions/assignments/{id}', + path: { + 'id': id, + }, + errors: { + 404: `Assignment not found`, + }, + }); + } + /** + * @returns PermissionSetSummary List permission sets + * @throws ApiError + */ + public static listPermissionSets({ + packRef, + }: { + packRef?: string | null, + }): CancelablePromise> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/permissions/sets', + query: { + 'pack_ref': packRef, + }, + }); + } +} diff --git a/web/src/api/services/RulesService.ts b/web/src/api/services/RulesService.ts index b2bc9cb..b9e15df 100644 --- a/web/src/api/services/RulesService.ts +++ b/web/src/api/services/RulesService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ApiResponse_RuleResponse } from '../models/ApiResponse_RuleResponse'; import type { CreateRuleRequest } from '../models/CreateRuleRequest'; import type { PaginatedResponse_RuleSummary } from '../models/PaginatedResponse_RuleSummary'; diff --git a/web/src/api/services/RuntimesService.ts b/web/src/api/services/RuntimesService.ts new file mode 100644 index 0000000..beadf87 --- /dev/null +++ b/web/src/api/services/RuntimesService.ts @@ -0,0 +1,172 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ApiResponse_RuntimeResponse } from '../models/ApiResponse_RuntimeResponse'; +import type { CreateRuntimeRequest } from '../models/CreateRuntimeRequest'; +import type { PaginatedResponse_RuntimeSummary } from '../models/PaginatedResponse_RuntimeSummary'; +import type { SuccessResponse } from '../models/SuccessResponse'; +import type { UpdateRuntimeRequest } from '../models/UpdateRuntimeRequest'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class RuntimesService { + /** + * @returns PaginatedResponse_RuntimeSummary List of runtimes for a pack + * @throws ApiError + */ + public static listRuntimesByPack({ + packRef, + page, + pageSize, + }: { + /** + * Pack reference identifier + */ + packRef: string, + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/packs/{pack_ref}/runtimes', + path: { + 'pack_ref': packRef, + }, + query: { + 'page': page, + 'page_size': pageSize, + }, + errors: { + 404: `Pack not found`, + }, + }); + } + /** + * @returns PaginatedResponse_RuntimeSummary List of runtimes + * @throws ApiError + */ + public static listRuntimes({ + page, + pageSize, + }: { + /** + * Page number (1-based) + */ + page?: number, + /** + * Number of items per page + */ + pageSize?: number, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/runtimes', + query: { + 'page': page, + 'page_size': pageSize, + }, + }); + } + /** + * @returns ApiResponse_RuntimeResponse Runtime created successfully + * @throws ApiError + */ + public static createRuntime({ + requestBody, + }: { + requestBody: CreateRuntimeRequest, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v1/runtimes', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Validation error`, + 404: `Pack not found`, + 409: `Runtime with same ref already exists`, + }, + }); + } + /** + * @returns ApiResponse_RuntimeResponse Runtime details + * @throws ApiError + */ + public static getRuntime({ + ref, + }: { + /** + * Runtime reference identifier + */ + ref: string, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/v1/runtimes/{ref}', + path: { + 'ref': ref, + }, + errors: { + 404: `Runtime not found`, + }, + }); + } + /** + * @returns ApiResponse_RuntimeResponse Runtime updated successfully + * @throws ApiError + */ + public static updateRuntime({ + ref, + requestBody, + }: { + /** + * Runtime reference identifier + */ + ref: string, + requestBody: UpdateRuntimeRequest, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/v1/runtimes/{ref}', + path: { + 'ref': ref, + }, + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Validation error`, + 404: `Runtime not found`, + }, + }); + } + /** + * @returns SuccessResponse Runtime deleted successfully + * @throws ApiError + */ + public static deleteRuntime({ + ref, + }: { + /** + * Runtime reference identifier + */ + ref: string, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/v1/runtimes/{ref}', + path: { + 'ref': ref, + }, + errors: { + 404: `Runtime not found`, + }, + }); + } +} diff --git a/web/src/api/services/SecretsService.ts b/web/src/api/services/SecretsService.ts index 4c313b1..66dbcf9 100644 --- a/web/src/api/services/SecretsService.ts +++ b/web/src/api/services/SecretsService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { CreateKeyRequest } from '../models/CreateKeyRequest'; import type { i64 } from '../models/i64'; import type { OwnerType } from '../models/OwnerType'; @@ -114,9 +114,9 @@ export class SecretsService { */ updated: string; /** - * The secret value (decrypted if encrypted) + * The secret value (decrypted if encrypted). Can be a string, object, array, number, or boolean. */ - value: string; + value: any; }; /** * Optional message @@ -200,9 +200,9 @@ export class SecretsService { */ updated: string; /** - * The secret value (decrypted if encrypted) + * The secret value (decrypted if encrypted). Can be a string, object, array, number, or boolean. */ - value: string; + value: any; }; /** * Optional message @@ -288,9 +288,9 @@ export class SecretsService { */ updated: string; /** - * The secret value (decrypted if encrypted) + * The secret value (decrypted if encrypted). Can be a string, object, array, number, or boolean. */ - value: string; + value: any; }; /** * Optional message diff --git a/web/src/api/services/SensorsService.ts b/web/src/api/services/SensorsService.ts index 92cb3e9..c239574 100644 --- a/web/src/api/services/SensorsService.ts +++ b/web/src/api/services/SensorsService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ApiResponse_SensorResponse } from '../models/ApiResponse_SensorResponse'; import type { CreateSensorRequest } from '../models/CreateSensorRequest'; import type { PaginatedResponse_SensorSummary } from '../models/PaginatedResponse_SensorSummary'; diff --git a/web/src/api/services/TriggersService.ts b/web/src/api/services/TriggersService.ts index cdaeb89..33ef196 100644 --- a/web/src/api/services/TriggersService.ts +++ b/web/src/api/services/TriggersService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { ApiResponse_TriggerResponse } from '../models/ApiResponse_TriggerResponse'; import type { CreateTriggerRequest } from '../models/CreateTriggerRequest'; import type { PaginatedResponse_TriggerSummary } from '../models/PaginatedResponse_TriggerSummary'; diff --git a/web/src/api/services/WebhooksService.ts b/web/src/api/services/WebhooksService.ts index 0ff6df6..cafbeb6 100644 --- a/web/src/api/services/WebhooksService.ts +++ b/web/src/api/services/WebhooksService.ts @@ -1,7 +1,7 @@ /* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ - +/* eslint-disable */ import type { TriggerResponse } from '../models/TriggerResponse'; import type { WebhookReceiverRequest } from '../models/WebhookReceiverRequest'; import type { WebhookReceiverResponse } from '../models/WebhookReceiverResponse'; diff --git a/web/src/components/forms/RuntimeForm.tsx b/web/src/components/forms/RuntimeForm.tsx new file mode 100644 index 0000000..aa8147c --- /dev/null +++ b/web/src/components/forms/RuntimeForm.tsx @@ -0,0 +1,347 @@ +import { useEffect, useMemo, useState } from "react"; +import { useNavigate } from "react-router-dom"; +import { usePacks } from "@/hooks/usePacks"; +import { useCreateRuntime, useUpdateRuntime } from "@/hooks/useRuntimes"; +import { + NullableJsonPatch, + NullableStringPatch, + type PackSummary, + type RuntimeResponse, +} from "@/api"; + +interface RuntimeFormProps { + initialData?: RuntimeResponse; + isEditing?: boolean; + onCancel?: () => void; +} + +type JsonObject = Record; + +function prettyJson(value: unknown): string { + return JSON.stringify(value ?? {}, null, 2); +} + +function validateObjectJson(label: string, raw: string): JsonObject { + if (!raw.trim()) { + throw new Error(`${label} is required`); + } + + try { + const parsed = JSON.parse(raw); + if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) { + throw new Error(`${label} must be a JSON object`); + } + return parsed as JsonObject; + } catch (error) { + if (error instanceof Error) { + throw error; + } + throw new Error(`${label} must be valid JSON`); + } +} + +function validateJsonValue(label: string, raw: string, required = true): any { + if (!raw.trim()) { + if (required) { + throw new Error(`${label} is required`); + } + return null; + } + + try { + return JSON.parse(raw) as any; + } catch { + throw new Error(`${label} must be valid JSON`); + } +} + +export default function RuntimeForm({ + initialData, + isEditing = false, + onCancel, +}: RuntimeFormProps) { + const navigate = useNavigate(); + const { data: packsData } = usePacks({ page: 1, pageSize: 200 }); + const packs = useMemo(() => packsData?.data || [], [packsData?.data]); + const createRuntime = useCreateRuntime(); + const updateRuntime = useUpdateRuntime(); + + const [ref, setRef] = useState(""); + const [packRef, setPackRef] = useState(""); + const [name, setName] = useState(""); + const [description, setDescription] = useState(""); + const [distributions, setDistributions] = useState("{}"); + const [installation, setInstallation] = useState(""); + const [executionConfig, setExecutionConfig] = useState("{}"); + const [errors, setErrors] = useState>({}); + + useEffect(() => { + if (!initialData) { + return; + } + + setRef(initialData.ref); + setPackRef(initialData.pack_ref ?? ""); + setName(initialData.name); + setDescription(initialData.description ?? ""); + setDistributions(prettyJson(initialData.distributions)); + setInstallation( + initialData.installation == null ? "" : prettyJson(initialData.installation), + ); + setExecutionConfig(prettyJson(initialData.execution_config)); + }, [initialData]); + + const canEditRef = !isEditing; + const isSubmitting = createRuntime.isPending || updateRuntime.isPending; + const selectedPackExists = + !packRef || packs.some((pack: PackSummary) => pack.ref === packRef); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + const newErrors: Record = {}; + + if (!ref.trim()) { + newErrors.ref = "Reference is required"; + } + if (!name.trim()) { + newErrors.name = "Name is required"; + } + if (packRef && !selectedPackExists) { + newErrors.pack_ref = "Selected pack does not exist"; + } + + let parsedDistributions: JsonObject | undefined; + let parsedExecutionConfig: JsonObject | undefined; + let parsedInstallation: any = null; + + try { + parsedDistributions = validateObjectJson("Distributions", distributions); + } catch (error) { + newErrors.distributions = + error instanceof Error ? error.message : "Invalid distributions JSON"; + } + + try { + parsedExecutionConfig = validateObjectJson( + "Execution config", + executionConfig, + ); + } catch (error) { + newErrors.execution_config = + error instanceof Error ? error.message : "Invalid execution config JSON"; + } + + try { + parsedInstallation = validateJsonValue("Installation", installation, false); + } catch (error) { + newErrors.installation = + error instanceof Error ? error.message : "Invalid installation JSON"; + } + + if (Object.keys(newErrors).length > 0) { + setErrors(newErrors); + return; + } + + try { + if (isEditing && initialData) { + await updateRuntime.mutateAsync({ + ref: initialData.ref, + data: { + description: description.trim() + ? { op: NullableStringPatch.op.SET, value: description.trim() } + : null, + name: name.trim(), + distributions: parsedDistributions, + installation: + installation.trim().length > 0 + ? { op: NullableJsonPatch.op.SET, value: parsedInstallation } + : null, + execution_config: parsedExecutionConfig, + }, + }); + navigate(`/runtimes/${encodeURIComponent(initialData.ref)}`); + } else { + const response = await createRuntime.mutateAsync({ + ref: ref.trim(), + pack_ref: packRef.trim() || null, + description: description.trim() || null, + name: name.trim(), + distributions: parsedDistributions, + installation: installation.trim().length > 0 ? parsedInstallation : null, + execution_config: parsedExecutionConfig, + }); + navigate(`/runtimes/${encodeURIComponent(response.data.ref)}`); + } + } catch (error: unknown) { + const axiosErr = error as { response?: { data?: { message?: string } } }; + setErrors({ + submit: + axiosErr?.response?.data?.message || + (error instanceof Error ? error.message : "Failed to save runtime"), + }); + } + }; + + return ( +
+
+

+ {isEditing ? "Edit Runtime" : "Create Runtime"} +

+

+ Configure the metadata and execution contract for a runtime. +

+
+ + {errors.submit && ( +
+ {errors.submit} +
+ )} + +
+
+

Basics

+ +
+ + setRef(e.target.value)} + disabled={!canEditRef} + className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm disabled:bg-gray-100" + placeholder="core.python" + /> + {errors.ref &&

{errors.ref}

} +
+ +
+ + setName(e.target.value)} + className="w-full rounded-lg border border-gray-300 px-3 py-2 text-sm" + placeholder="Python" + /> + {errors.name && ( +

{errors.name}

+ )} +
+ +
+ + + {errors.pack_ref && ( +

{errors.pack_ref}

+ )} +
+ +
+ +