mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-22 09:14:25 +08:00
feat..去除了冗余的字体文件,又修改了PLONDS系统
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsAssetEntry(
|
||||
string AssetId,
|
||||
string FileName,
|
||||
string Sha256,
|
||||
long Size,
|
||||
IReadOnlyList<PlondsMirrorEntry> Mirrors);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsChangedFileEntry(
|
||||
string ArchivePath,
|
||||
string Hash,
|
||||
long Size,
|
||||
string HashAlgorithm = "sha256");
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsChannelPointer(
|
||||
string Channel,
|
||||
string Platform,
|
||||
string DistributionId,
|
||||
string Version,
|
||||
DateTimeOffset PublishedAt,
|
||||
string? DistributionPath = null,
|
||||
string? FileMapPath = null);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsComponent(
|
||||
string Id,
|
||||
string Root,
|
||||
string Mode,
|
||||
IReadOnlyList<PlondsFileEntry> Files,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsDistributionInfo(
|
||||
string DistributionId,
|
||||
string Version,
|
||||
string Channel,
|
||||
string Platform,
|
||||
DateTimeOffset PublishedAt,
|
||||
IReadOnlyList<PlondsComponent> Components,
|
||||
IReadOnlyList<PlondsMirrorAsset> InstallerMirrors,
|
||||
IReadOnlyList<string> Capabilities,
|
||||
IReadOnlyList<PlondsSignatureDescriptor> Signatures,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsFileEntry(
|
||||
string Path,
|
||||
string Op,
|
||||
string ContentHash,
|
||||
string Action,
|
||||
string Hash,
|
||||
long Size,
|
||||
string Mode,
|
||||
string? ObjectKey = null,
|
||||
string? Compression = null,
|
||||
string? PatchBaseHash = null,
|
||||
string? PatchObjectKey = null);
|
||||
|
||||
string HashAlgorithm = "sha256");
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsFileMap(
|
||||
string FormatVersion,
|
||||
string DistributionId,
|
||||
string SourceVersion,
|
||||
string TargetVersion,
|
||||
string Platform,
|
||||
IReadOnlyList<PlondsComponent> Components,
|
||||
IReadOnlyList<string> Capabilities,
|
||||
IReadOnlyList<PlondsSignatureDescriptor> Signatures,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsManifest(
|
||||
string FormatVersion,
|
||||
string ReleaseTag,
|
||||
DateTimeOffset GeneratedAt,
|
||||
IReadOnlyList<PlondsAssetEntry> Assets);
|
||||
string CurrentVersion,
|
||||
string PreviousVersion,
|
||||
bool IsFullUpdate,
|
||||
bool RequiresCleanInstall,
|
||||
string Channel,
|
||||
string Platform,
|
||||
DateTimeOffset UpdatedAt,
|
||||
string CompareMethod,
|
||||
[property: JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
string? HashAlgorithm,
|
||||
IReadOnlyDictionary<string, PlondsFileEntry> FilesMap,
|
||||
IReadOnlyDictionary<string, PlondsChangedFileEntry> ChangedFilesMap,
|
||||
IReadOnlyDictionary<string, string> Checksums);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsMetadataCatalog(
|
||||
string ProtocolName,
|
||||
string ProtocolVersion,
|
||||
string StorageRoot,
|
||||
string MetaRoot,
|
||||
IReadOnlyList<PlondsChannelPointer> Latest,
|
||||
IReadOnlyDictionary<string, string>? Metadata = null);
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsMirrorAsset(
|
||||
string Platform,
|
||||
string Arch,
|
||||
string Url,
|
||||
string? FileName = null,
|
||||
string? Sha256 = null,
|
||||
long Size = 0);
|
||||
@@ -1,5 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsMirrorEntry(
|
||||
string Type,
|
||||
string Url);
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsReleaseManifest(
|
||||
string FormatVersion,
|
||||
string ReleaseTag,
|
||||
string Version,
|
||||
string Channel,
|
||||
DateTimeOffset GeneratedAt,
|
||||
IReadOnlyList<PlondsReleasePlatformEntry> Platforms);
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsReleasePlatformEntry(
|
||||
string Platform,
|
||||
string DistributionId,
|
||||
string? BaselineTag,
|
||||
string? BaselineVersion,
|
||||
string TargetVersion,
|
||||
bool IsFullPayload,
|
||||
string FilesZipAsset,
|
||||
string UpdateZipAsset,
|
||||
string FileMapAsset,
|
||||
string FileMapSignatureAsset,
|
||||
string Sha256);
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Plonds.Shared.Models;
|
||||
|
||||
public sealed record PlondsSignatureDescriptor(
|
||||
string Algorithm,
|
||||
string KeyId,
|
||||
string Signature);
|
||||
|
||||
@@ -3,23 +3,39 @@ namespace Plonds.Shared;
|
||||
public static class PlondsConstants
|
||||
{
|
||||
public const string ProtocolName = "PLONDS";
|
||||
public const string ProtocolVersion = "1.0";
|
||||
public const string ProtocolVersion = "2.0";
|
||||
public const string FormatVersion = "2.0";
|
||||
|
||||
public const string DefaultApiBasePath = "/api/plonds/v1";
|
||||
public const string DefaultStorageRoot = "sample-data";
|
||||
public const string DefaultMetaRoot = "meta";
|
||||
public const string DefaultRepoRoot = "repo";
|
||||
public const string DefaultInstallersRoot = "installers";
|
||||
public const string ActionAdd = "add";
|
||||
public const string ActionReplace = "replace";
|
||||
public const string ActionReuse = "reuse";
|
||||
public const string ActionDelete = "delete";
|
||||
|
||||
public const string FileObjectMode = "file-object";
|
||||
public const string CompressedObjectMode = "compressed-object";
|
||||
public const string BinaryPatchMode = "binary-patch";
|
||||
public const string CompareMethodFileCompare = "file-compare";
|
||||
public const string CompareMethodCommitAnalyze = "commit-analyze";
|
||||
|
||||
public static readonly string[] SupportedFileModes =
|
||||
public const string HashAlgorithmSha256 = "sha256";
|
||||
public const string HashAlgorithmMd5 = "md5";
|
||||
|
||||
public const string DefaultLauncherRelativePath = "LanMountainDesktop.Launcher.exe";
|
||||
|
||||
public static readonly string[] SupportedActions =
|
||||
[
|
||||
FileObjectMode,
|
||||
CompressedObjectMode,
|
||||
BinaryPatchMode
|
||||
ActionAdd,
|
||||
ActionReplace,
|
||||
ActionReuse,
|
||||
ActionDelete
|
||||
];
|
||||
|
||||
public static readonly string[] SupportedHashAlgorithms =
|
||||
[
|
||||
HashAlgorithmSha256,
|
||||
HashAlgorithmMd5
|
||||
];
|
||||
|
||||
public static readonly string[] SupportedCompareMethods =
|
||||
[
|
||||
CompareMethodFileCompare,
|
||||
CompareMethodCommitAnalyze
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Plonds.Shared;
|
||||
|
||||
public enum PlondsFileAction
|
||||
{
|
||||
Add,
|
||||
Replace,
|
||||
Reuse,
|
||||
Delete
|
||||
}
|
||||
Reference in New Issue
Block a user