55
66namespace Aspire . Cli . Backchannel ;
77
8- /// <summary>
9- /// Represents the state of a resource reported via RPC.
10- /// </summary>
11- internal sealed class RpcResourceState
12- {
13- /// <summary>
14- /// Gets the name of the resource.
15- /// </summary>
16- public required string Resource { get ; init ; }
17-
18- /// <summary>
19- /// Gets the type of the resource.
20- /// </summary>
21- public required string Type { get ; init ; }
22-
23- /// <summary>
24- /// Gets the state of the resource.
25- /// </summary>
26- public required string State { get ; init ; }
27-
28- /// <summary>
29- /// Gets the endpoints associated with the resource.
30- /// </summary>
31- public required string [ ] Endpoints { get ; init ; }
32-
33- /// <summary>
34- /// Gets the health status of the resource.
35- /// </summary>
36- public string ? Health { get ; init ; }
37- }
38-
39- /// <summary>
40- /// Represents dashboard URLs with authentication tokens.
41- /// </summary>
42- internal sealed class DashboardUrlsState
43- {
44- /// <summary>
45- /// Gets the base dashboard URL with a login token.
46- /// </summary>
47- public required string BaseUrlWithLoginToken { get ; init ; }
48-
49- /// <summary>
50- /// Gets the Codespaces dashboard URL with a login token, if available.
51- /// </summary>
52- public string ? CodespacesUrlWithLoginToken { get ; init ; }
53- }
54-
558/// <summary>
569/// Represents a single line of output to be displayed, along with its associated stream (such as "stdout" or "stderr").
5710/// </summary>
@@ -68,78 +21,6 @@ internal sealed class DisplayLineState(string stream, string line)
6821 public string Line { get ; } = line ;
6922}
7023
71- /// <summary>
72- /// Envelope for publishing activity items sent over the backchannel.
73- /// </summary>
74- internal sealed class PublishingActivity
75- {
76- /// <summary>
77- /// Gets the type discriminator for the publishing activity item.
78- /// </summary>
79- public required string Type { get ; init ; }
80-
81- /// <summary>
82- /// Gets the data containing all properties for the publishing activity item.
83- /// </summary>
84- public required PublishingActivityData Data { get ; init ; }
85- }
86-
87- /// <summary>
88- /// Common data for all publishing activity items.
89- /// </summary>
90- internal sealed class PublishingActivityData
91- {
92- /// <summary>
93- /// Gets the unique identifier for the publishing activity.
94- /// </summary>
95- public required string Id { get ; init ; }
96-
97- /// <summary>
98- /// Gets the status text describing the publishing activity.
99- /// </summary>
100- public required string StatusText { get ; init ; }
101-
102- /// <summary>
103- /// Gets the completion state of the publishing activity.
104- /// </summary>
105- public string CompletionState { get ; init ; } = CompletionStates . InProgress ;
106-
107- /// <summary>
108- /// Gets a value indicating whether the publishing activity is complete.
109- /// </summary>
110- public bool IsComplete => CompletionState is not CompletionStates . InProgress ;
111-
112- /// <summary>
113- /// Gets a value indicating whether the publishing activity encountered an error.
114- /// </summary>
115- public bool IsError => CompletionState is CompletionStates . CompletedWithError ;
116-
117- /// <summary>
118- /// Gets a value indicating whether the publishing activity completed with warnings.
119- /// </summary>
120- public bool IsWarning => CompletionState is CompletionStates . CompletedWithWarning ;
121-
122- /// <summary>
123- /// Gets the identifier of the step this task belongs to (only applicable for tasks).
124- /// </summary>
125- public string ? StepId { get ; init ; }
126-
127- /// <summary>
128- /// Gets the completion message for the publishing activity (optional).
129- /// </summary>
130- public string ? CompletionMessage { get ; init ; }
131- }
132-
133- /// <summary>
134- /// Constants for publishing activity item types.
135- /// </summary>
136- internal static class PublishingActivityTypes
137- {
138- public const string Step = "step" ;
139- public const string Task = "task" ;
140- public const string PublishComplete = "publish-complete" ;
141- }
142-
14324internal class BackchannelLogEntry
14425{
14526 public required EventId EventId { get ; set ; }
@@ -148,14 +29,3 @@ internal class BackchannelLogEntry
14829 public required DateTimeOffset Timestamp { get ; set ; }
14930 public required string CategoryName { get ; set ; }
15031}
151-
152- /// <summary>
153- /// Constants for completion state values.
154- /// </summary>
155- internal static class CompletionStates
156- {
157- public const string InProgress = "InProgress" ;
158- public const string Completed = "Completed" ;
159- public const string CompletedWithWarning = "CompletedWithWarning" ;
160- public const string CompletedWithError = "CompletedWithError" ;
161- }
0 commit comments