diff --git a/build_bindings.sh b/build_bindings.sh index 4ba6ac97..71e90e7e 100755 --- a/build_bindings.sh +++ b/build_bindings.sh @@ -17,6 +17,7 @@ REPOS=( "https://github.com/echo8/pastesphere.git" "https://github.com/marukun712/AniBlue.git" "https://github.com/lexicon-community/lexicon.git" + "https://github.com/icidasset/radical-edward.git" ) PWD=$(pwd) @@ -61,6 +62,8 @@ do REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/web/lexicons") elif [ "$target_dir" == "lexicon-community-lexicon" ]; then REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/community/lexicon") + elif [ "$target_dir" == "icidasset-radical-edward" ]; then + REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/apps/byov/lexicons/ma/tokono/byov") else REPO_DIRS+=("$(PWD)/../fflexicons/$target_dir/lexicons") fi diff --git a/src/FishyFlip/Lexicon/ATObject.g.cs b/src/FishyFlip/Lexicon/ATObject.g.cs index 6afdcbdc..a7bda19d 100644 --- a/src/FishyFlip/Lexicon/ATObject.g.cs +++ b/src/FishyFlip/Lexicon/ATObject.g.cs @@ -392,6 +392,7 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(Com.Atproto.Repo.StrongRef), typeDiscriminator: "com.atproto.repo.strongRef")] [JsonDerivedType(typeof(Tools.Ozone.Moderation.SubjectStatusView), typeDiscriminator: "tools.ozone.moderation.defs#subjectStatusView")] [JsonDerivedType(typeof(Com.Atproto.Identity.SubmitPlcOperationInput), typeDiscriminator: "com.atproto.identity.submitPlcOperation#SubmitPlcOperationInput")] + [JsonDerivedType(typeof(Ma.Tokono.Byov.Subscription), typeDiscriminator: "ma.tokono.byov.subscription")] [JsonDerivedType(typeof(App.Bsky.Unspecced.Suggestion), typeDiscriminator: "app.bsky.unspecced.getTaggedSuggestions#suggestion")] [JsonDerivedType(typeof(App.Bsky.Richtext.Tag), typeDiscriminator: "app.bsky.richtext.facet#tag")] [JsonDerivedType(typeof(Tools.Ozone.Communication.TemplateView), typeDiscriminator: "tools.ozone.communication.defs#templateView")] @@ -428,6 +429,7 @@ namespace FishyFlip.Lexicon [JsonDerivedType(typeof(Tools.Ozone.Setting.UpsertOptionInput), typeDiscriminator: "tools.ozone.setting.upsertOption#UpsertOptionInput")] [JsonDerivedType(typeof(Tools.Ozone.Setting.UpsertOptionOutput), typeDiscriminator: "tools.ozone.setting.upsertOption#UpsertOptionOutput")] [JsonDerivedType(typeof(My.Skylights.UrlItem), typeDiscriminator: "my.skylights.rel#urlItem")] + [JsonDerivedType(typeof(Ma.Tokono.Byov.Video), typeDiscriminator: "ma.tokono.byov.video")] [JsonDerivedType(typeof(Tools.Ozone.Moderation.VideoDetails), typeDiscriminator: "tools.ozone.moderation.defs#videoDetails")] [JsonDerivedType(typeof(App.Bsky.Embed.ViewBlocked), typeDiscriminator: "app.bsky.embed.record#viewBlocked")] [JsonDerivedType(typeof(App.Bsky.Embed.ViewDetached), typeDiscriminator: "app.bsky.embed.record#viewDetached")] diff --git a/src/FishyFlip/Lexicon/CborExtensions.g.cs b/src/FishyFlip/Lexicon/CborExtensions.g.cs index bf4a6472..782863c9 100644 --- a/src/FishyFlip/Lexicon/CborExtensions.g.cs +++ b/src/FishyFlip/Lexicon/CborExtensions.g.cs @@ -799,6 +799,8 @@ public static ATObject ToATObject(this CBORObject obj) return new Tools.Ozone.Moderation.SubjectStatusView(obj); case "com.atproto.identity.submitPlcOperation#SubmitPlcOperationInput": return new Com.Atproto.Identity.SubmitPlcOperationInput(obj); + case "ma.tokono.byov.subscription": + return new Ma.Tokono.Byov.Subscription(obj); case "app.bsky.unspecced.getTaggedSuggestions#suggestion": return new App.Bsky.Unspecced.Suggestion(obj); case "app.bsky.richtext.facet#tag": @@ -871,6 +873,8 @@ public static ATObject ToATObject(this CBORObject obj) return new Tools.Ozone.Setting.UpsertOptionOutput(obj); case "my.skylights.rel#urlItem": return new My.Skylights.UrlItem(obj); + case "ma.tokono.byov.video": + return new Ma.Tokono.Byov.Video(obj); case "tools.ozone.moderation.defs#videoDetails": return new Tools.Ozone.Moderation.VideoDetails(obj); case "app.bsky.embed.record#viewBlocked": diff --git a/src/FishyFlip/Lexicon/Ma/Tokono/Byov/ATProtoByovExtensions.g.cs b/src/FishyFlip/Lexicon/Ma/Tokono/Byov/ATProtoByovExtensions.g.cs new file mode 100644 index 00000000..7ec29c80 --- /dev/null +++ b/src/FishyFlip/Lexicon/Ma/Tokono/Byov/ATProtoByovExtensions.g.cs @@ -0,0 +1,249 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +using FishyFlip.Lexicon.Com.Atproto.Repo; + +namespace FishyFlip.Lexicon.Ma.Tokono.Byov +{ + + /// + /// Extension methods for ma.tokono.byov. + /// + public static class ATProtoByovExtensions + { + + /// + /// Create a Subscription record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateSubscriptionAsync(this FishyFlip.ATProtocol atp, Ma.Tokono.Byov.Subscription record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.subscription", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Subscription record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateSubscriptionAsync(this FishyFlip.ATProtocol atp, string? subject, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Ma.Tokono.Byov.Subscription(); + record.CreatedAt = createdAt ?? DateTime.UtcNow; + record.Subject = subject; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.subscription", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Subscription record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "ma.tokono.byov.subscription", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Subscription record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Ma.Tokono.Byov.Subscription record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "ma.tokono.byov.subscription", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Subscription records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "ma.tokono.byov.subscription", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Subscription records. + /// + /// + /// + /// + /// + /// + public static Task> ListSubscriptionAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.subscription", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Subscription records. + /// + /// + /// + /// + /// + /// + public static Task> GetSubscriptionAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "ma.tokono.byov.subscription", rkey, cid, cancellationToken); + } + + /// + /// Get Subscription records. + /// + /// + /// + /// + /// + public static Task> GetSubscriptionAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.subscription", rkey, cid, cancellationToken); + } + /// + /// Create a Video record. + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateVideoAsync(this FishyFlip.ATProtocol atp, Ma.Tokono.Byov.Video record, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.video", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Create a Video record. + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> CreateVideoAsync(this FishyFlip.ATProtocol atp, string? cid, string? id, string? serviceProvider, string? title, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + var record = new FishyFlip.Lexicon.Ma.Tokono.Byov.Video(); + record.Cid = cid; + record.CreatedAt = createdAt ?? DateTime.UtcNow; + record.Id = id; + record.ServiceProvider = serviceProvider; + record.Title = title; + return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.video", record, rkey, validate, swapCommit, cancellationToken); + } + + /// + /// Delete a Video record. + /// + /// + /// + /// + /// + /// + /// + public static Task> DeleteVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.DeleteRecordAsync(repo, "ma.tokono.byov.video", rkey, swapRecord, swapCommit, cancellationToken); + } + + /// + /// Put a Video record. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Task> PutVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, Ma.Tokono.Byov.Video record, bool? validate = default, string? swapRecord = default, string? swapCommit = default, CancellationToken cancellationToken = default) + { + return atp.PutRecordAsync(repo, "ma.tokono.byov.video", rkey, record, validate, swapRecord, swapCommit, cancellationToken); + } + + /// + /// List Video records. + /// + /// + /// + /// + /// + /// + /// + public static Task> ListVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(repo, "ma.tokono.byov.video", limit, cursor, reverse, cancellationToken); + } + + /// + /// List Video records. + /// + /// + /// + /// + /// + /// + public static Task> ListVideoAsync(this FishyFlip.ATProtocol atp, int? limit = 50, string? cursor = default, bool? reverse = default, CancellationToken cancellationToken = default) + { + return atp.ListRecordsAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.video", limit, cursor, reverse, cancellationToken); + } + + /// + /// Get Video records. + /// + /// + /// + /// + /// + /// + public static Task> GetVideoAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATIdentifier repo, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(repo, "ma.tokono.byov.video", rkey, cid, cancellationToken); + } + + /// + /// Get Video records. + /// + /// + /// + /// + /// + public static Task> GetVideoAsync(this FishyFlip.ATProtocol atp, string rkey, string? cid = default, CancellationToken cancellationToken = default) + { + return atp.GetRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "ma.tokono.byov.video", rkey, cid, cancellationToken); + } + } +} + diff --git a/src/FishyFlip/Lexicon/Ma/Tokono/Byov/Subscription.g.cs b/src/FishyFlip/Lexicon/Ma/Tokono/Byov/Subscription.g.cs new file mode 100644 index 00000000..577fe4aa --- /dev/null +++ b/src/FishyFlip/Lexicon/Ma/Tokono/Byov/Subscription.g.cs @@ -0,0 +1,75 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Ma.Tokono.Byov +{ + /// + /// A channel subscription. + /// + public partial class Subscription : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// + /// + public Subscription(string? subject, DateTime? createdAt = default) + { + this.CreatedAt = createdAt ?? DateTime.UtcNow; + this.Subject = subject; + } + + + /// + /// Initializes a new instance of the class. + /// + public Subscription() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Subscription(CBORObject obj) + { + if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); + if (obj["subject"] is not null) this.Subject = obj["subject"].AsString(); + } + + /// + /// Gets or sets the createdAt. + /// + [JsonPropertyName("createdAt")] + public DateTime? CreatedAt { get; set; } = default; + + /// + /// Gets or sets the subject. + /// + [JsonPropertyName("subject")] + public string? Subject { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "ma.tokono.byov.subscription"; + + public const string RecordType = "ma.tokono.byov.subscription"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.MaTokonoByovSubscription)!; + } + + public static Subscription FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.MaTokonoByovSubscription)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/Ma/Tokono/Byov/Video.g.cs b/src/FishyFlip/Lexicon/Ma/Tokono/Byov/Video.g.cs new file mode 100644 index 00000000..d3c3162f --- /dev/null +++ b/src/FishyFlip/Lexicon/Ma/Tokono/Byov/Video.g.cs @@ -0,0 +1,102 @@ +// +// This file was generated by FFSourceGen. +// Do not modify this file. + +#nullable enable + +namespace FishyFlip.Lexicon.Ma.Tokono.Byov +{ + /// + /// A reference to a video. + /// + public partial class Video : ATObject + { + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + public Video(string? cid, string? id, string? serviceProvider, string? title, DateTime? createdAt = default) + { + this.Cid = cid; + this.CreatedAt = createdAt ?? DateTime.UtcNow; + this.Id = id; + this.ServiceProvider = serviceProvider; + this.Title = title; + } + + + /// + /// Initializes a new instance of the class. + /// + public Video() + { + } + + + /// + /// Initializes a new instance of the class. + /// + public Video(CBORObject obj) + { + if (obj["cid"] is not null) this.Cid = obj["cid"].AsString(); + if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime(); + if (obj["id"] is not null) this.Id = obj["id"].AsString(); + if (obj["serviceProvider"] is not null) this.ServiceProvider = obj["serviceProvider"].AsString(); + if (obj["title"] is not null) this.Title = obj["title"].AsString(); + } + + /// + /// Gets or sets the cid. + /// + [JsonPropertyName("cid")] + public string? Cid { get; set; } + + /// + /// Gets or sets the createdAt. + /// + [JsonPropertyName("createdAt")] + public DateTime? CreatedAt { get; set; } = default; + + /// + /// Gets or sets the id. + /// + [JsonPropertyName("id")] + public string? Id { get; set; } + + /// + /// Gets or sets the serviceProvider. + /// + [JsonPropertyName("serviceProvider")] + public string? ServiceProvider { get; set; } + + /// + /// Gets or sets the title. + /// + [JsonPropertyName("title")] + public string? Title { get; set; } + + /// + /// Gets the ATRecord Type. + /// + [JsonPropertyName("$type")] + public override string Type => "ma.tokono.byov.video"; + + public const string RecordType = "ma.tokono.byov.video"; + + public override string ToJson() + { + return JsonSerializer.Serialize(this, (JsonTypeInfo)SourceGenerationContext.Default.MaTokonoByovVideo)!; + } + + public static Video FromJson(string json) + { + return JsonSerializer.Deserialize(json, (JsonTypeInfo)SourceGenerationContext.Default.MaTokonoByovVideo)!; + } + } +} + diff --git a/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs b/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs index 6c1bcd80..a36de2f1 100644 --- a/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs +++ b/src/FishyFlip/Lexicon/SourceGenerationContext.g.cs @@ -795,6 +795,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListToolsOzoneModerationSubjectStatusView")] [JsonSerializable(typeof(FishyFlip.Lexicon.Com.Atproto.Identity.SubmitPlcOperationInput), TypeInfoPropertyName = "ComAtprotoIdentitySubmitPlcOperationInput")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListComAtprotoIdentitySubmitPlcOperationInput")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Ma.Tokono.Byov.Subscription), TypeInfoPropertyName = "MaTokonoByovSubscription")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListMaTokonoByovSubscription")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Unspecced.Suggestion), TypeInfoPropertyName = "AppBskyUnspeccedSuggestion")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListAppBskyUnspeccedSuggestion")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Richtext.Tag), TypeInfoPropertyName = "AppBskyRichtextTag")] @@ -867,6 +869,8 @@ namespace FishyFlip.Lexicon [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListToolsOzoneSettingUpsertOptionOutput")] [JsonSerializable(typeof(FishyFlip.Lexicon.My.Skylights.UrlItem), TypeInfoPropertyName = "MySkylightsUrlItem")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListMySkylightsUrlItem")] + [JsonSerializable(typeof(FishyFlip.Lexicon.Ma.Tokono.Byov.Video), TypeInfoPropertyName = "MaTokonoByovVideo")] + [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListMaTokonoByovVideo")] [JsonSerializable(typeof(FishyFlip.Lexicon.Tools.Ozone.Moderation.VideoDetails), TypeInfoPropertyName = "ToolsOzoneModerationVideoDetails")] [JsonSerializable(typeof(List), TypeInfoPropertyName = "ListToolsOzoneModerationVideoDetails")] [JsonSerializable(typeof(FishyFlip.Lexicon.App.Bsky.Embed.ViewBlocked), TypeInfoPropertyName = "AppBskyEmbedViewBlocked")] diff --git a/tools/FFSourceGen/PropertyGeneration.cs b/tools/FFSourceGen/PropertyGeneration.cs index a9f1077a..1c7b15ca 100644 --- a/tools/FFSourceGen/PropertyGeneration.cs +++ b/tools/FFSourceGen/PropertyGeneration.cs @@ -168,6 +168,7 @@ private string GenerateCborProperty() "boolean" => $"if (obj[\"{this.Key}\"] is not null) this.{this.PropertyName} = obj[\"{this.Key}\"].AsBoolean();", "bytes" => $"if (obj[\"{this.Key}\"] is not null) this.{this.PropertyName} = obj[\"{this.Key}\"].EncodeToBytes();", "cid-link" => $"if (obj[\"{this.Key}\"] is not null) this.{this.PropertyName} = obj[\"{this.Key}\"].ToATCid();", + "datetime" => $"if (obj[\"{this.Key}\"] is not null) this.{this.PropertyName} = obj[\"{this.Key}\"].ToDateTime();", "unknown" => this.GenerateCborPropertyForUnknownType(property), "object" => this.GenericObjectToCborType(property), "record" => $"if (obj[\"{this.Key}\"] is not null) this.{this.PropertyName} = obj[\"{this.Key}\"].ToATObject();", @@ -327,6 +328,7 @@ private string GetPropertyType(string className, string name, PropertyDefinition "string" when property.Format == "at-uri" => "FishyFlip.Models.ATUri", "string" when property.Format == "at-identifier" => "FishyFlip.Models.ATIdentifier", "string" => "string", + "datetime" => "DateTime", "blob" => "Blob", "integer" => "long", "boolean" => "bool",