Skip to content

Commit 42c8aab

Browse files
committed
Finish implementation of root event stream handlers and containing virtual collection handlers.
1 parent a7f2a9e commit 42c8aab

34 files changed

Lines changed: 2080 additions & 181 deletions

src/IModifiableProject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/// <summary>
44
/// Represents a project that can be modified.
55
/// </summary>
6-
public interface IModifiableProject : IReadOnlyProject<IModifiableProjectCollection<IReadOnlyProject>>, IModifiableEntity, IModifiableImagesCollection, IModifiableUserRoleCollection, IModifiableAccentColor, IModifiableFeaturesCollection
6+
public interface IModifiableProject : IReadOnlyProject, IReadOnlyProject<IModifiableProjectCollection<IReadOnlyProject>>, IModifiableEntity, IModifiableImagesCollection, IModifiableUserRoleCollection, IModifiableAccentColor, IModifiableFeaturesCollection
77
{
88
/// <summary>
99
/// Updates the publisher for this project.

src/IModifiablePublisher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
/// <summary>
44
/// Represents a content publisher that can be modified.
55
/// </summary>
6-
public interface IModifiablePublisher : IReadOnlyPublisher<IModifiablePublisherCollection<IReadOnlyPublisher>>, IModifiableEntity, IModifiableAccentColor, IModifiableUserRoleCollection
6+
public interface IModifiablePublisher : IReadOnlyPublisher<IModifiablePublisherCollection<IReadOnlyPublisher>>, IReadOnlyPublisher, IModifiableEntity, IModifiableAccentColor, IModifiableUserRoleCollection
77
{
88
}

src/Models/IProjectCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ public interface IProjectCollection
1111
/// Represents a list of registered projects.
1212
/// </summary>
1313
Cid[] Projects { get; set; }
14-
}
14+
}

src/Models/IProjectRoleCollection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections.Generic;
21
using Ipfs;
32

43
namespace WindowsAppCommunity.Sdk.Models;
@@ -11,5 +10,5 @@ public interface IProjectRoleCollection
1110
/// <summary>
1211
/// Represents a list of registered projects along with the role on each.
1312
/// </summary>
14-
(Cid, DagCid)[] Projects { get; set; }
13+
(Cid ProjectId, DagCid RoleCid)[] Projects { get; set; }
1514
}

src/Models/IPublisherCollection.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 WindowsAppCommunity.Sdk.Models;
4+
5+
/// <summary>
6+
/// Represents a published collection of publishers.
7+
/// </summary>
8+
public interface IPublisherCollection
9+
{
10+
/// <summary>
11+
/// Represents a list of registered publishers.
12+
/// </summary>
13+
Cid[] Publishers { get; set; }
14+
}

src/Models/IPublisherRoleCollection.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections.Generic;
21
using Ipfs;
32

43
namespace WindowsAppCommunity.Sdk.Models;
@@ -11,5 +10,5 @@ public interface IPublisherRoleCollection
1110
/// <summary>
1211
/// Represents a list of registered publishers along with the role on each.
1312
/// </summary>
14-
public (Cid, DagCid)[] Publishers { get; set; }
13+
public (Cid PublisherId, DagCid RoleCid)[] Publishers { get; set; }
1514
}

src/Models/IUserRoleCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ public interface IUserRoleCollection
1010
/// <summary>
1111
/// Represents a list of registered users along with the role on each.
1212
/// </summary>
13-
public (Cid, DagCid)[] Users { get; set; }
13+
public (Cid UserId, DagCid RoleCid)[] Users { get; set; }
1414
}

src/Models/Project.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using Ipfs;
2+
using OwlCore.ComponentModel;
23
using System.Collections.Generic;
34

45
namespace WindowsAppCommunity.Sdk.Models;
56

67
/// <summary>
78
/// Represents a project.
89
/// </summary>
9-
public record Project : IEntity, IUserRoleCollection, IAccentColor, IProjectCollection
10+
public record Project : IEntity, IUserRoleCollection, IAccentColor, IProjectCollection, ISources<Cid>
1011
{
1112
/// <summary>
1213
/// The canonical publisher for this project.
@@ -77,4 +78,8 @@ public record Project : IEntity, IUserRoleCollection, IAccentColor, IProjectColl
7778
/// A flag indicating whether this is a non-public project.
7879
/// </summary>
7980
public bool IsUnlisted { get; set; }
81+
82+
/// <summary>
83+
/// The event stream sources for this project.
84+
public required ICollection<Cid> Sources { get; init; }
8085
}

src/Models/ProjectCollection.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 WindowsAppCommunity.Sdk.Models;
4+
5+
/// <summary>
6+
/// Represents a published collection of publishers.
7+
/// </summary>
8+
public record PublisherCollection : IPublisherCollection
9+
{
10+
/// <summary>
11+
/// Represents a list of registered publishers.
12+
/// </summary>
13+
public Cid[] Publishers { get; set; } = [];
14+
}

src/Models/Publisher.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using Ipfs;
2+
using OwlCore.ComponentModel;
23
using System.Collections.Generic;
34

45
namespace WindowsAppCommunity.Sdk.Models;
56

67
/// <summary>
78
/// Represents a content publisher.
89
/// </summary>
9-
public record Publisher : IEntity, ILinkCollection, IProjectCollection, IUserRoleCollection, IConnections, IAccentColor
10+
public record Publisher : IEntity, ILinkCollection, IProjectCollection, IUserRoleCollection, IConnections, IAccentColor, ISources<Cid>
1011
{
1112
/// <summary>
1213
/// The name of the publisher.
@@ -51,12 +52,12 @@ public record Publisher : IEntity, ILinkCollection, IProjectCollection, IUserRol
5152
/// <summary>
5253
/// A list of other publishers who are managed under this publisher.
5354
/// </summary>
54-
public Cid[] ParentPublishers { get; set; } = [];
55+
public PublisherCollection ParentPublishers { get; set; } = new();
5556

5657
/// <summary>
5758
/// A list of other publishers who are managed under this publisher.
5859
/// </summary>
59-
public Cid[] ChildPublishers { get; set; } = [];
60+
public PublisherCollection ChildPublishers { get; set; } = new();
6061

6162
/// <summary>
6263
/// Holds information about publisher assets that have been published for consumption by an end user, such as a Microsoft Store app, a package on nuget.org, a git repo, etc.
@@ -72,4 +73,7 @@ public record Publisher : IEntity, ILinkCollection, IProjectCollection, IUserRol
7273
/// A flag indicating whether this is a non-public publisher.
7374
/// </summary>
7475
public bool IsUnlisted { get; set; }
76+
77+
/// <inheritdoc/>
78+
public required ICollection<Cid> Sources { get; init; }
7579
}

0 commit comments

Comments
 (0)