Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// <auto-generated />
// This file was generated by FFSourceGen.
// Do not modify this file.

#nullable enable annotations
#nullable disable warnings

namespace FishyFlip.Xrpc.Lexicon.Com.Atproto.Lexicon
{

/// <summary>
/// com.atproto.lexicon XRPC Group.
/// </summary>
[ApiController]
public abstract class LexiconController : ControllerBase
{

/// <summary>
/// Resolves an atproto lexicon (NSID) to a schema.
/// <br/> Possible Errors: <br/>
/// <see cref="FishyFlip.Lexicon.LexiconNotFoundError"/> No lexicon was resolved for the NSID. <br/>
/// </summary>
/// <param name="nsid">The lexicon NSID to resolve.</param>
/// <param name="cancellationToken"></param>
/// <returns>Result of <see cref="FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput"/></returns>
[HttpGet("/xrpc/com.atproto.lexicon.resolveLexicon")]
public abstract Task<Results<ATResult<FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput>, ATErrorResult>> ResolveLexiconAsync ([FromQuery] string nsid, CancellationToken cancellationToken = default);
}
}

2 changes: 2 additions & 0 deletions src/FishyFlip/ATJetStreamBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public ATJetStreamBuilder(ATJetStreamOptions options)

/// <summary>
/// Set the instance url to connect to.
/// Alternatives are listed at https://github.com/bluesky-social/jetstream/tree/main?tab=readme-ov-file#public-instances.
/// Defaults to https://jetstream1.us-east.bsky.network.
/// </summary>
/// <param name="url">Instance Url.</param>
/// <returns><see cref="ATJetStreamBuilder"/>.</returns>
Expand Down
2 changes: 1 addition & 1 deletion src/FishyFlip/ATJetStreamOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ATJetStreamOptions
/// <param name="customAtObjectConverters">Customer JSON Converters for ATObject.</param>
public ATJetStreamOptions(IReadOnlyList<ICustomATObjectJsonConverter>? customAtObjectConverters = null)
{
this.Url = new Uri("https://jetstream.atproto.tools");
this.Url = new Uri("https://jetstream1.us-east.bsky.network");
this.Compression = false;
this.JsonSerializerOptions = new JsonSerializerOptions()
{
Expand Down
2 changes: 2 additions & 0 deletions src/FishyFlip/Lexicon/ATErrorGenerator.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public static FishyFlip.Models.ATError Generate(int statusCode, ErrorDetail deta
return new RuleNotFoundError(statusCode, detail);
case "HostBanned":
return new HostBannedError(statusCode, detail);
case "LexiconNotFound":
return new LexiconNotFoundError(statusCode, detail);
case "BadQueryString":
return new BadQueryStringError(statusCode, detail);
case "FutureCursor":
Expand Down
2 changes: 2 additions & 0 deletions src/FishyFlip/Lexicon/ATObject.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ public override string ToString()
return JsonSerializer.Deserialize<FishyFlip.Lexicon.Com.Atproto.Identity.ResolveDidOutput>(data, (JsonTypeInfo<FishyFlip.Lexicon.Com.Atproto.Identity.ResolveDidOutput>)SourceGenerationContext.Default.ComAtprotoIdentityResolveDidOutput);
case "com.atproto.identity.resolveHandle#ResolveHandleOutput":
return JsonSerializer.Deserialize<FishyFlip.Lexicon.Com.Atproto.Identity.ResolveHandleOutput>(data, (JsonTypeInfo<FishyFlip.Lexicon.Com.Atproto.Identity.ResolveHandleOutput>)SourceGenerationContext.Default.ComAtprotoIdentityResolveHandleOutput);
case "com.atproto.lexicon.resolveLexicon#ResolveLexiconOutput":
return JsonSerializer.Deserialize<FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput>(data, (JsonTypeInfo<FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput>)SourceGenerationContext.Default.ComAtprotoLexiconResolveLexiconOutput);
case "com.atproto.temp.checkHandleAvailability#resultAvailable":
return JsonSerializer.Deserialize<FishyFlip.Lexicon.Com.Atproto.Temp.ResultAvailable>(data, (JsonTypeInfo<FishyFlip.Lexicon.Com.Atproto.Temp.ResultAvailable>)SourceGenerationContext.Default.ComAtprotoTempResultAvailable);
case "com.atproto.temp.checkHandleAvailability#resultUnavailable":
Expand Down
5 changes: 5 additions & 0 deletions src/FishyFlip/Lexicon/ATProtocol.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public sealed partial class ATProtocol
/// </summary>
public FishyFlip.Lexicon.Com.Atproto.Label.ATProtoLabel Label => new (this);

/// <summary>
/// com.atproto.lexicon Endpoint Group.
/// </summary>
public FishyFlip.Lexicon.Com.Atproto.Lexicon.ATProtoLexicon Lexicon => new (this);

/// <summary>
/// com.atproto.moderation Endpoint Group.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ public static class ATProtoGraphExtensions
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateFollowAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATDid? subject, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
public static Task<Result<CreateRecordOutput?>> CreateFollowAsync(this FishyFlip.ATProtocol atp, FishyFlip.Models.ATDid? subject, DateTime? createdAt = default, Com.Atproto.Repo.StrongRef? via = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
var record = new FishyFlip.Lexicon.App.Bsky.Graph.Follow();
record.Subject = subject;
record.CreatedAt = createdAt ?? DateTime.UtcNow;
record.Via = via;
return atp.CreateRecordAsync(atp.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "app.bsky.graph.follow", record, rkey, validate, swapCommit, cancellationToken);
}

Expand Down
15 changes: 14 additions & 1 deletion src/FishyFlip/Lexicon/App/Bsky/Graph/Follow.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ public partial class Follow : ATObject, ICBOREncodable<Follow>, IJsonEncodable<F
/// </summary>
/// <param name="subject"></param>
/// <param name="createdAt"></param>
public Follow(FishyFlip.Models.ATDid? subject, DateTime? createdAt = default)
/// <param name="via">
/// <see cref="FishyFlip.Lexicon.Com.Atproto.Repo.StrongRef"/> (com.atproto.repo.strongRef)
/// </param>
public Follow(FishyFlip.Models.ATDid? subject, DateTime? createdAt = default, Com.Atproto.Repo.StrongRef? via = default)
{
this.Subject = subject;
this.CreatedAt = createdAt ?? DateTime.UtcNow;
this.Via = via;
this.Type = "app.bsky.graph.follow";
}

Expand All @@ -42,6 +46,7 @@ public Follow(CBORObject obj)
{
if (obj["subject"] is not null) this.Subject = obj["subject"].ToATDid();
if (obj["createdAt"] is not null) this.CreatedAt = obj["createdAt"].ToDateTime();
if (obj["via"] is not null) this.Via = new FishyFlip.Lexicon.Com.Atproto.Repo.StrongRef(obj["via"]);
if (obj["$type"] is not null) this.Type = obj["$type"].AsString();
}

Expand All @@ -60,6 +65,14 @@ public Follow(CBORObject obj)
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public DateTime? CreatedAt { get; set; } = DateTime.UtcNow;

/// <summary>
/// Gets or sets the via.
/// <br/> <see cref="FishyFlip.Lexicon.Com.Atproto.Repo.StrongRef"/> (com.atproto.repo.strongRef)
/// </summary>
[JsonPropertyName("via")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Com.Atproto.Repo.StrongRef? Via { get; set; }

public const string RecordType = "app.bsky.graph.follow";

public override string ToJson()
Expand Down
6 changes: 5 additions & 1 deletion src/FishyFlip/Lexicon/App/Bsky/Graph/GraphExtensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,19 @@ public static class BlueskyGraphExtensions
/// <param name="atp"></param>
/// <param name="subject"></param>
/// <param name="createdAt"></param>
/// <param name="via">
/// <see cref="FishyFlip.Lexicon.Com.Atproto.Repo.StrongRef"/> (com.atproto.repo.strongRef)
/// </param>
/// <param name="rkey"></param>
/// <param name="validate"></param>
/// <param name="swapCommit"></param>
/// <param name="cancellationToken"></param>
public static Task<Result<CreateRecordOutput?>> CreateFollowAsync(this FishyFlip.Lexicon.App.Bsky.Graph.BlueskyGraph atp, FishyFlip.Models.ATDid? subject, DateTime? createdAt = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
public static Task<Result<CreateRecordOutput?>> CreateFollowAsync(this FishyFlip.Lexicon.App.Bsky.Graph.BlueskyGraph atp, FishyFlip.Models.ATDid? subject, DateTime? createdAt = default, Com.Atproto.Repo.StrongRef? via = default, string? rkey = default, bool? validate = default, string? swapCommit = default, CancellationToken cancellationToken = default)
{
var record = new FishyFlip.Lexicon.App.Bsky.Graph.Follow();
record.Subject = subject;
record.CreatedAt = createdAt ?? DateTime.UtcNow;
record.Via = via;
return atp.ATProtocol.CreateRecordAsync(atp.ATProtocol.SessionManager.Session?.Did ?? throw new InvalidOperationException("Session did is required."), "app.bsky.graph.follow", record, rkey, validate, swapCommit, cancellationToken);
}

Expand Down
2 changes: 2 additions & 0 deletions src/FishyFlip/Lexicon/CborExtensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@ public static ATObject ToATObject(this CBORObject obj, IReadOnlyList<ICustomATOb
return new Com.Atproto.Identity.ResolveDidOutput(obj);
case "com.atproto.identity.resolveHandle#ResolveHandleOutput":
return new Com.Atproto.Identity.ResolveHandleOutput(obj);
case "com.atproto.lexicon.resolveLexicon#ResolveLexiconOutput":
return new Com.Atproto.Lexicon.ResolveLexiconOutput(obj);
case "com.atproto.temp.checkHandleAvailability#resultAvailable":
return new Com.Atproto.Temp.ResultAvailable(obj);
case "com.atproto.temp.checkHandleAvailability#resultUnavailable":
Expand Down
48 changes: 48 additions & 0 deletions src/FishyFlip/Lexicon/Com/Atproto/Lexicon/ATProtoLexicon.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// <auto-generated />
// This file was generated by FFSourceGen.
// Do not modify this file.

#nullable enable annotations
#nullable disable warnings

namespace FishyFlip.Lexicon.Com.Atproto.Lexicon
{

/// <summary>
/// com.atproto.lexicon Endpoint Class.
/// </summary>
public sealed class ATProtoLexicon
{

private ATProtocol atp;

/// <summary>
/// Initializes a new instance of the <see cref="ATProtoLexicon"/> class.
/// </summary>
/// <param name="atp"><see cref="ATProtocol"/>.</param>
internal ATProtoLexicon(ATProtocol atp)
{
this.atp = atp;
}

/// <summary>
/// Gets the ATProtocol.
/// </summary>
internal ATProtocol ATProtocol => this.atp;


/// <summary>
/// Resolves an atproto lexicon (NSID) to a schema.
/// <br/> Possible Errors: <br/>
/// <see cref="FishyFlip.Lexicon.LexiconNotFoundError"/> No lexicon was resolved for the NSID. <br/>
/// </summary>
/// <param name="nsid">The lexicon NSID to resolve.</param>
/// <param name="cancellationToken"></param>
public Task<Result<FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput?>> ResolveLexiconAsync (string nsid, CancellationToken cancellationToken = default)
{
return atp.ResolveLexiconAsync(nsid, cancellationToken);
}

}
}

50 changes: 50 additions & 0 deletions src/FishyFlip/Lexicon/Com/Atproto/Lexicon/LexiconEndpoints.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// <auto-generated />
// This file was generated by FFSourceGen.
// Do not modify this file.

#nullable enable annotations
#nullable disable warnings

namespace FishyFlip.Lexicon.Com.Atproto.Lexicon
{

/// <summary>
/// com.atproto.lexicon Endpoint Group.
/// </summary>
public static class LexiconEndpoints
{

public const string GroupNamespace = "com.atproto.lexicon";

public const string ResolveLexicon = "/xrpc/com.atproto.lexicon.resolveLexicon";


/// <summary>
/// Resolves an atproto lexicon (NSID) to a schema.
/// <br/> Possible Errors: <br/>
/// <see cref="FishyFlip.Lexicon.LexiconNotFoundError"/> No lexicon was resolved for the NSID. <br/>
/// </summary>
/// <param name="atp"></param>
/// <param name="nsid">The lexicon NSID to resolve.</param>
/// <param name="cancellationToken"></param>
/// <returns>Result of <see cref="FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput?"/></returns>
public static Task<Result<FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput?>> ResolveLexiconAsync (this FishyFlip.ATProtocol atp, string nsid, CancellationToken cancellationToken = default)
{
var endpointUrl = ResolveLexicon.ToString();
endpointUrl += "?";
List<string> queryStrings = new();
queryStrings.Add("nsid=" + nsid);

var headers = new Dictionary<string, string>();
if (atp.TryFetchProxy(GroupNamespace, out var proxyUrl))
{
headers.Add(Constants.AtProtoProxy, proxyUrl);
}
headers.Add(Constants.AtProtoAcceptLabelers, atp.Options.LabelDefinitionsHeader);
endpointUrl += string.Join("&", queryStrings);
return atp.Get<FishyFlip.Lexicon.Com.Atproto.Lexicon.ResolveLexiconOutput>(endpointUrl, atp.Options.SourceGenerationContext.ComAtprotoLexiconResolveLexiconOutput!, cancellationToken, headers);
}

}
}

Loading