feat(import): complete OpenAPI onboarding and verify delivery
This commit is contained in:
1 parent
bb3e376767
commit
e93de7015a
244 files changed
+57020
-5139
No files matched your search
+151
-21
@@ -353,6 +353,35 @@ pub struct OnboardingResponse {
|
||||
pub platform_api_key_id: Option<String>,
|
||||
pub mcp_endpoint: Option<String>,
|
||||
pub first_call: Option<OnboardingFirstCallEvidence>,
|
||||
pub import_context: Option<OnboardingImportContextView>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OnboardingImportChoiceView {
|
||||
pub key: String,
|
||||
pub name: String,
|
||||
pub outcome: String,
|
||||
pub operation_id: Option<String>,
|
||||
pub version: Option<u32>,
|
||||
pub reason: Option<String>,
|
||||
pub selectable: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OnboardingImportDriftView {
|
||||
pub reason: String,
|
||||
pub current_operation_version: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OnboardingImportContextView {
|
||||
pub application_idempotency_key: String,
|
||||
pub plan_digest: String,
|
||||
pub report: Value,
|
||||
pub choices: Vec<OnboardingImportChoiceView>,
|
||||
pub selected_operation_id: Option<String>,
|
||||
pub selected_operation_version: Option<u32>,
|
||||
pub drift: Option<OnboardingImportDriftView>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
@@ -375,6 +404,38 @@ pub struct ResetOnboardingSelectionResponse {
|
||||
pub onboarding: OnboardingResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct RegisterOnboardingImportContextPayload {
|
||||
pub application_idempotency_key: String,
|
||||
pub plan_digest: String,
|
||||
pub expected_revision: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct RegisterOnboardingImportContextResponse {
|
||||
pub registered: bool,
|
||||
#[serde(flatten)]
|
||||
pub onboarding: OnboardingResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct SelectOnboardingImportDraftPayload {
|
||||
pub application_idempotency_key: String,
|
||||
pub plan_digest: String,
|
||||
pub operation_id: String,
|
||||
pub operation_version: u32,
|
||||
pub expected_revision: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct SelectOnboardingImportDraftResponse {
|
||||
pub selected: bool,
|
||||
#[serde(flatten)]
|
||||
pub onboarding: OnboardingResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct WorkspaceCatalogSnapshotResponse {
|
||||
pub kind: String,
|
||||
@@ -542,48 +603,34 @@ pub struct OpenApiImportPreviewResponse {
|
||||
pub job_id: String,
|
||||
pub expires_at: String,
|
||||
pub preview: crank_import::rest::ImportPreview,
|
||||
/// Compatible Auth Profiles visible to the current workspace, grouped by
|
||||
/// operation and security alternative. Profile credentials are never
|
||||
/// included.
|
||||
pub auth_profile_choices: Vec<OpenApiAuthProfileChoice>,
|
||||
#[serde(default)]
|
||||
pub security_profile_choices: Vec<OpenApiImportSecurityProfileChoice>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OpenApiAuthProfileChoice {
|
||||
pub struct OpenApiImportSecurityProfileChoice {
|
||||
pub operation_key: String,
|
||||
pub alternative_index: usize,
|
||||
pub scheme_names: Vec<String>,
|
||||
pub supported: bool,
|
||||
pub profiles: Vec<OpenApiAuthProfileOption>,
|
||||
pub schemes: Vec<String>,
|
||||
pub profiles: Vec<OpenApiImportAuthProfileChoice>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OpenApiAuthProfileOption {
|
||||
pub struct OpenApiImportAuthProfileChoice {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub kind: AuthKind,
|
||||
pub kind: crank_core::AuthKind,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
pub struct OpenApiImportCreatePayload {
|
||||
pub selected_operation_keys: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub auth_mappings: Vec<OpenApiAuthMapping>,
|
||||
#[serde(default)]
|
||||
pub server_url: Option<String>,
|
||||
#[serde(default = "default_openapi_conflict_mode")]
|
||||
pub conflict_mode: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct OpenApiAuthMapping {
|
||||
pub operation_key: String,
|
||||
pub alternative_index: usize,
|
||||
/// `None` is an explicit unresolved mapping. It is never actionable for a
|
||||
/// required authentication alternative.
|
||||
pub auth_profile_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OpenApiImportCreateResponse {
|
||||
pub created: Vec<OpenApiImportCreatedOperation>,
|
||||
@@ -606,6 +653,89 @@ pub struct OpenApiImportSkippedOperation {
|
||||
pub reason: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct OpenApiImportPlanCreatePayload {
|
||||
#[serde(default = "default_openapi_plan_selection_mode")]
|
||||
pub selection_mode: String,
|
||||
#[serde(default)]
|
||||
pub selected_operation_keys: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub server_url: Option<String>,
|
||||
#[serde(default)]
|
||||
pub decisions: Vec<OpenApiImportPlanDecision>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct OpenApiImportPlanApplyPayload {
|
||||
pub plan_digest: String,
|
||||
pub idempotency_key: String,
|
||||
}
|
||||
|
||||
fn default_openapi_plan_selection_mode() -> String {
|
||||
"full".to_owned()
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct OpenApiImportPlanDecision {
|
||||
pub operation_key: String,
|
||||
pub action: String,
|
||||
#[serde(default)]
|
||||
pub target_operation_id: Option<String>,
|
||||
#[serde(default)]
|
||||
pub confirmed_name: Option<String>,
|
||||
#[serde(default)]
|
||||
pub auth_profile_id: Option<String>,
|
||||
#[serde(default)]
|
||||
pub security_alternative_index: Option<usize>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize)]
|
||||
pub struct OpenApiImportPlanCounts {
|
||||
pub selected: usize,
|
||||
pub excluded: usize,
|
||||
pub actionable: usize,
|
||||
pub blocked: usize,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize)]
|
||||
pub struct OpenApiImportPlanCandidateView {
|
||||
pub key: String,
|
||||
pub name: String,
|
||||
pub state: String,
|
||||
pub action: Option<String>,
|
||||
pub target_operation_id: Option<String>,
|
||||
pub confirmed_name: Option<String>,
|
||||
pub auth_profile_id: Option<String>,
|
||||
pub security_alternative_index: Option<usize>,
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OpenApiImportPlanCreateResponse {
|
||||
pub plan_reference: String,
|
||||
pub plan_digest: String,
|
||||
pub catalog_revision: String,
|
||||
pub support_matrix_version: String,
|
||||
pub expires_at: String,
|
||||
pub selection_mode: String,
|
||||
pub counts: OpenApiImportPlanCounts,
|
||||
pub candidates: Vec<OpenApiImportPlanCandidateView>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct OpenApiImportPlanRevalidationResponse {
|
||||
pub plan_reference: String,
|
||||
pub plan_digest: String,
|
||||
pub revalidation_status: String,
|
||||
pub revalidation_required: bool,
|
||||
pub reason: Option<String>,
|
||||
pub counts: OpenApiImportPlanCounts,
|
||||
pub candidates: Vec<OpenApiImportPlanCandidateView>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize)]
|
||||
pub struct CreatedOperationResponse {
|
||||
pub operation_id: String,
|
||||
|
||||
Reference in new issue
Block a user