Skip to content

Commit d6eb2f4

Browse files
committed
Checkpoint: Models, AppModels and Event Stream Entries
1 parent f3c9e84 commit d6eb2f4

24 files changed

Lines changed: 305 additions & 623 deletions

src/Models/IAccentColor.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace WinAppCommunity.Sdk.Models;
2+
3+
/// <summary>
4+
/// Represents an accent color.
5+
/// </summary>
6+
public interface IAccentColor
7+
{
8+
/// <summary>
9+
/// A hex-encoded accent color.
10+
/// </summary>
11+
public string? AccentColor { get; set; }
12+
}

src/Models/IConnections.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Collections.Generic;
2+
using Ipfs;
3+
4+
namespace WinAppCommunity.Sdk.Models;
5+
6+
/// <summary>
7+
/// Represents a published collection of key-value connection pairs.
8+
/// </summary>
9+
public interface IConnections
10+
{
11+
/// <summary>
12+
/// Represents data about external application connections.
13+
/// </summary>
14+
Dictionary<string, DagCid> Connections { get; set; }
15+
}

src/Models/IEntity.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
namespace WinAppCommunity.Sdk.Models;
2+
3+
/// <summary>
4+
/// Represents a published entity.
5+
/// </summary>
6+
public interface IEntity : IConnections, IImages
7+
{
8+
/// <summary>
9+
/// The name of the entity.
10+
/// </summary>
11+
string Name { get; set; }
12+
13+
/// <summary>
14+
/// A description of the entity. Supports markdown.
15+
/// </summary>
16+
string Description { get; set; }
17+
18+
/// <summary>
19+
/// An extended description of the entity. Supports markdown.
20+
/// </summary>
21+
string ExtendedDescription { get; set; }
22+
23+
/// <summary>
24+
/// A flag that indicates whether the entity has requested to be forgotten.
25+
/// </summary>
26+
bool? ForgetMe { get; set; }
27+
28+
/// <summary>
29+
/// A flag indicating whether this is an unlisted project.
30+
/// </summary>
31+
public bool IsUnlisted { get; set; }
32+
}

src/Models/IImages.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Ipfs;
2+
3+
namespace WinAppCommunity.Sdk.Models;
4+
5+
/// <summary>
6+
/// Represents a published collection of images.
7+
/// </summary>
8+
public interface IImages
9+
{
10+
/// <summary>
11+
/// A list of <see cref="Image"/> objects.
12+
/// </summary>
13+
Image[] Images { get; set; }
14+
}

src/Models/ILinkCollection.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace WinAppCommunity.Sdk.Models;
2+
3+
/// <summary>
4+
/// Represents a published collection of links.
5+
/// </summary>
6+
public interface ILinkCollection
7+
{
8+
/// <summary>
9+
/// Represents links to external profiles or resources added by the user.
10+
/// </summary>
11+
Link[] Links { get; set; }
12+
}

src/Models/IName.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Collections.Generic;
2+
using Ipfs;
3+
4+
namespace WinAppCommunity.Sdk.Models;
5+
6+
/// <summary>
7+
/// Represents a published collection of projects and roles on each.
8+
/// </summary>
9+
public interface IProjectRoleCollection
10+
{
11+
/// <summary>
12+
/// Represents a list of registered projects along with the role on each.
13+
/// </summary>
14+
Dictionary<DagCid, Role> Projects { get; set; }
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Collections.Generic;
2+
using Ipfs;
3+
4+
namespace WinAppCommunity.Sdk.Models;
5+
6+
/// <summary>
7+
/// Represents a published collection of publishers and roles on each.
8+
/// </summary>
9+
public interface IPublisherRoleCollection
10+
{
11+
/// <summary>
12+
/// Represents a list of registered publishers along with the role on each.
13+
/// </summary>
14+
public Dictionary<DagCid, Role> Publishers { get; set; }
15+
}

src/Models/IUserRoleCollection.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Collections.Generic;
2+
using Ipfs;
3+
4+
namespace WinAppCommunity.Sdk.Models;
5+
6+
/// <summary>
7+
/// Represents a list of registered users along with the role on each.
8+
/// </summary>
9+
public interface IUserRoleCollection
10+
{
11+
/// <summary>
12+
/// Represents a list of registered users along with the role on each.
13+
/// </summary>
14+
public Dictionary<DagCid, Role> Users { get; set; }
15+
}

src/Models/Image.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Ipfs;
2+
using OwlCore.Storage;
3+
4+
namespace WinAppCommunity.Sdk.Models;
5+
6+
/// <summary>
7+
/// Represents image metadata.
8+
/// </summary>
9+
public record Image : IStorable
10+
{
11+
/// <summary>
12+
/// A unique identifier for this Image that is persistent across runs and property updates.
13+
/// </summary>
14+
public required string Id { get; init; }
15+
16+
/// <summary>
17+
/// A display name for this image.
18+
/// </summary>
19+
public required string Name { get; set; }
20+
21+
/// <summary>
22+
/// A content identifier of a file with this image's content.
23+
/// </summary>
24+
public required DagCid Cid { get; init; }
25+
}

0 commit comments

Comments
 (0)