Restructure solution layout by module
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace StellaOps.Signals.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Metadata describing the stored raw callgraph artifact.
|
||||
/// </summary>
|
||||
public sealed class CallgraphArtifactMetadata
|
||||
{
|
||||
[BsonElement("path")]
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("hash")]
|
||||
public string Hash { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("contentType")]
|
||||
public string ContentType { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("length")]
|
||||
public long Length { get; set; }
|
||||
}
|
||||
41
src/Signals/StellaOps.Signals/Models/CallgraphDocument.cs
Normal file
41
src/Signals/StellaOps.Signals/Models/CallgraphDocument.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace StellaOps.Signals.Models;
|
||||
|
||||
/// <summary>
|
||||
/// MongoDB document representing an ingested callgraph.
|
||||
/// </summary>
|
||||
public sealed class CallgraphDocument
|
||||
{
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.ObjectId)]
|
||||
public string Id { get; set; } = ObjectId.GenerateNewId().ToString();
|
||||
|
||||
[BsonElement("language")]
|
||||
public string Language { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("component")]
|
||||
public string Component { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("version")]
|
||||
public string Version { get; set; } = string.Empty;
|
||||
|
||||
[BsonElement("ingestedAt")]
|
||||
public DateTimeOffset IngestedAt { get; set; }
|
||||
|
||||
[BsonElement("artifact")]
|
||||
public CallgraphArtifactMetadata Artifact { get; set; } = new();
|
||||
|
||||
[BsonElement("nodes")]
|
||||
public List<CallgraphNode> Nodes { get; set; } = new();
|
||||
|
||||
[BsonElement("edges")]
|
||||
public List<CallgraphEdge> Edges { get; set; } = new();
|
||||
|
||||
[BsonElement("metadata")]
|
||||
[BsonIgnoreIfNull]
|
||||
public Dictionary<string, string?>? Metadata { get; set; }
|
||||
}
|
||||
9
src/Signals/StellaOps.Signals/Models/CallgraphEdge.cs
Normal file
9
src/Signals/StellaOps.Signals/Models/CallgraphEdge.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace StellaOps.Signals.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Normalized callgraph edge.
|
||||
/// </summary>
|
||||
public sealed record CallgraphEdge(
|
||||
string SourceId,
|
||||
string TargetId,
|
||||
string Type);
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace StellaOps.Signals.Models;
|
||||
|
||||
/// <summary>
|
||||
/// API request payload for callgraph ingestion.
|
||||
/// </summary>
|
||||
public sealed record CallgraphIngestRequest(
|
||||
[property: Required] string Language,
|
||||
[property: Required] string Component,
|
||||
[property: Required] string Version,
|
||||
[property: Required] string ArtifactContentType,
|
||||
[property: Required] string ArtifactFileName,
|
||||
[property: Required] string ArtifactContentBase64,
|
||||
IReadOnlyDictionary<string, string?>? Metadata);
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace StellaOps.Signals.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Response returned after callgraph ingestion.
|
||||
/// </summary>
|
||||
public sealed record CallgraphIngestResponse(
|
||||
string CallgraphId,
|
||||
string ArtifactPath,
|
||||
string ArtifactHash);
|
||||
12
src/Signals/StellaOps.Signals/Models/CallgraphNode.cs
Normal file
12
src/Signals/StellaOps.Signals/Models/CallgraphNode.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace StellaOps.Signals.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Normalized callgraph node.
|
||||
/// </summary>
|
||||
public sealed record CallgraphNode(
|
||||
string Id,
|
||||
string Name,
|
||||
string Kind,
|
||||
string? Namespace,
|
||||
string? File,
|
||||
int? Line);
|
||||
Reference in New Issue
Block a user