From 3a97aae25a17c5807b1335afdd79bcfd9d45d646 Mon Sep 17 00:00:00 2001 From: Scott Prutton Date: Tue, 10 Oct 2023 12:19:35 -0400 Subject: [PATCH] feat: change interfaces to types for quickinfo --- lib/sdf-server/src/server/service/func.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/sdf-server/src/server/service/func.rs b/lib/sdf-server/src/server/service/func.rs index db94a8677d..c004bc3be9 100644 --- a/lib/sdf-server/src/server/service/func.rs +++ b/lib/sdf-server/src/server/service/func.rs @@ -590,32 +590,32 @@ pub fn compile_return_types(ty: FuncBackendResponseType, kind: FuncBackendKind) FuncBackendResponseType::String => "type Output = string | null;", FuncBackendResponseType::Integer => "type Output = number | null;", FuncBackendResponseType::Qualification => { - "interface Output { + "type Output { result: 'success' | 'warning' | 'failure'; message?: string | null; }" } FuncBackendResponseType::CodeGeneration => { - "interface Output { + "type Output { format: string; code: string; }" } FuncBackendResponseType::Validation => { - "interface Output { + "type Output { valid: boolean; message: string; }" } FuncBackendResponseType::Reconciliation => { - "interface Output { + "type Output { updates: { [key: string]: unknown }; actions: string[]; message: string | null; }" } FuncBackendResponseType::Action => { - "interface Output { + "type Output { status: 'ok' | 'warning' | 'error'; payload?: { [key: string]: unknown } | null; message?: string | null; @@ -651,32 +651,32 @@ pub fn compile_return_types_2(ty: FuncBackendResponseType, kind: FuncBackendKind FuncBackendResponseType::String => "type Output = string | null;", FuncBackendResponseType::Integer => "type Output = number | null;", FuncBackendResponseType::Qualification => { - "interface Output { + "type Output { result: 'success' | 'warning' | 'failure'; message?: string | null; }" } FuncBackendResponseType::CodeGeneration => { - "interface Output { + "type Output { format: string; code: string; }" } FuncBackendResponseType::Validation => { - "interface Output { + "type Output { valid: boolean; message: string; }" } FuncBackendResponseType::Reconciliation => { - "interface Output { + "type Output { updates: { [key: string]: unknown }; actions: string[]; message: string | null; }" } FuncBackendResponseType::Action => { - "interface Output { + "type Output { status: 'ok' | 'warning' | 'error'; payload?: { [key: string]: unknown } | null; message?: string | null; @@ -855,7 +855,7 @@ async fn compile_action_types( } Ok(format!( - "interface Input {{ + "type Input {{ kind: 'standard'; properties: {}; }}",