From e40ba6459c8356f2f19c2ed8257d5f5c6a096fd0 Mon Sep 17 00:00:00 2001 From: "daniel.yuan" Date: Mon, 1 Jun 2026 17:37:27 +0800 Subject: [PATCH] AII-836 --- .../Interfaces/IMembaseApi.cs | 3 ++ .../Responses/PgtExternalCompleteResponse.cs | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/Plugins/BotSharp.Plugin.Membase/Models/Responses/PgtExternalCompleteResponse.cs diff --git a/src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs b/src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs index 124fd1d19..f210c86d9 100644 --- a/src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs +++ b/src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs @@ -58,5 +58,8 @@ public interface IMembaseApi [Post("/graph/{graphId}/pgt-definitions/{definitionId}/validate")] Task ValidatePgtDefinitionAsync(string graphId, string definitionId, [Body] PgtValidationRequest request); + + [Post("/graph/{graphId}/pgt-external/{correlationId}/complete")] + Task CompletePgtExternalAsync(string graphId, string correlationId); #endregion } diff --git a/src/Plugins/BotSharp.Plugin.Membase/Models/Responses/PgtExternalCompleteResponse.cs b/src/Plugins/BotSharp.Plugin.Membase/Models/Responses/PgtExternalCompleteResponse.cs new file mode 100644 index 000000000..d1f513be8 --- /dev/null +++ b/src/Plugins/BotSharp.Plugin.Membase/Models/Responses/PgtExternalCompleteResponse.cs @@ -0,0 +1,42 @@ +using System.Text.Json.Serialization; + +namespace BotSharp.Plugin.Membase.Models; + +public class PgtExternalCompleteResponse +{ + public PgtExternalTask Task { get; set; } = new(); + + [JsonPropertyName("already_completed")] + public bool AlreadyCompleted { get; set; } +} + +public class PgtExternalTask +{ + public string TaskId { get; set; } = string.Empty; + public string RunId { get; set; } = string.Empty; + public string GraphId { get; set; } = string.Empty; + public string NodeId { get; set; } = string.Empty; + public string TaskType { get; set; } = string.Empty; + public string CorrelationId { get; set; } = string.Empty; + public string Status { get; set; } = string.Empty; + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Dictionary? Request { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Dictionary? Response { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public object? Error { get; set; } + + public DateTime CreatedAt { get; set; } + public DateTime UpdatedAt { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DateTime? CompletedAt { get; set; } + + public long NotBefore { get; set; } + + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DateTime? ClaimedAt { get; set; } +}