Skip to content

Commit

Permalink
Use official atproto lexicons for #account and #identity.
Browse files Browse the repository at this point in the history
Fixes #13
  • Loading branch information
christiandeange committed Dec 7, 2024
1 parent cdf4a59 commit 688479b
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 34 deletions.
121 changes: 103 additions & 18 deletions jetstream/api/jetstream.api
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
public final class app/bsky/jetstream/SubscribeAccount {
public static final field Companion Lapp/bsky/jetstream/SubscribeAccount$Companion;
public synthetic fun <init> (ZLjava/lang/String;JLjava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Z
public synthetic fun <init> (JLjava/lang/String;Lkotlinx/datetime/Instant;ZLapp/bsky/jetstream/SubscribeStatus;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (JLjava/lang/String;Lkotlinx/datetime/Instant;ZLapp/bsky/jetstream/SubscribeStatus;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()J
public final fun component2-715Ygxc ()Ljava/lang/String;
public final fun component3 ()J
public final fun component4 ()Ljava/lang/String;
public final fun copy-b3ibVOY (ZLjava/lang/String;JLjava/lang/String;)Lapp/bsky/jetstream/SubscribeAccount;
public static synthetic fun copy-b3ibVOY$default (Lapp/bsky/jetstream/SubscribeAccount;ZLjava/lang/String;JLjava/lang/String;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeAccount;
public final fun component3 ()Lkotlinx/datetime/Instant;
public final fun component4 ()Z
public final fun component5 ()Lapp/bsky/jetstream/SubscribeStatus;
public final fun copy-HTZSsLY (JLjava/lang/String;Lkotlinx/datetime/Instant;ZLapp/bsky/jetstream/SubscribeStatus;)Lapp/bsky/jetstream/SubscribeAccount;
public static synthetic fun copy-HTZSsLY$default (Lapp/bsky/jetstream/SubscribeAccount;JLjava/lang/String;Lkotlinx/datetime/Instant;ZLapp/bsky/jetstream/SubscribeStatus;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeAccount;
public fun equals (Ljava/lang/Object;)Z
public final fun getActive ()Z
public final fun getDid-715Ygxc ()Ljava/lang/String;
public final fun getSeq ()J
public final fun getTime ()Ljava/lang/String;
public final fun getStatus ()Lapp/bsky/jetstream/SubscribeStatus;
public final fun getTime ()Lkotlinx/datetime/Instant;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
Expand Down Expand Up @@ -76,18 +79,19 @@ public final class app/bsky/jetstream/SubscribeEvent$Companion {

public final class app/bsky/jetstream/SubscribeIdentity {
public static final field Companion Lapp/bsky/jetstream/SubscribeIdentity$Companion;
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1-715Ygxc ()Ljava/lang/String;
public final fun component2-hDwCUG8 ()Ljava/lang/String;
public final fun component3 ()J
public final fun component4 ()Ljava/lang/String;
public final fun copy-dB0H9Ao (Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;)Lapp/bsky/jetstream/SubscribeIdentity;
public static synthetic fun copy-dB0H9Ao$default (Lapp/bsky/jetstream/SubscribeIdentity;Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeIdentity;
public synthetic fun <init> (JLjava/lang/String;Lkotlinx/datetime/Instant;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (JLjava/lang/String;Lkotlinx/datetime/Instant;Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()J
public final fun component2-715Ygxc ()Ljava/lang/String;
public final fun component3 ()Lkotlinx/datetime/Instant;
public final fun component4-367xRBg ()Ljava/lang/String;
public final fun copy-DUhffl4 (JLjava/lang/String;Lkotlinx/datetime/Instant;Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeIdentity;
public static synthetic fun copy-DUhffl4$default (Lapp/bsky/jetstream/SubscribeIdentity;JLjava/lang/String;Lkotlinx/datetime/Instant;Ljava/lang/String;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeIdentity;
public fun equals (Ljava/lang/Object;)Z
public final fun getDid-715Ygxc ()Ljava/lang/String;
public final fun getHandle-hDwCUG8 ()Ljava/lang/String;
public final fun getHandle-367xRBg ()Ljava/lang/String;
public final fun getSeq ()J
public final fun getTime ()Ljava/lang/String;
public final fun getTime ()Lkotlinx/datetime/Instant;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
Expand Down Expand Up @@ -117,8 +121,8 @@ public final class app/bsky/jetstream/SubscribeKind$Commit : app/bsky/jetstream/
}

public final class app/bsky/jetstream/SubscribeKind$Companion {
public final fun safeValueOf (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeKind;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
public final fun unsafeValueOf (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeKind;
}

public final class app/bsky/jetstream/SubscribeKind$Identity : app/bsky/jetstream/SubscribeKind {
Expand All @@ -128,6 +132,17 @@ public final class app/bsky/jetstream/SubscribeKind$Identity : app/bsky/jetstrea
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeKind$Unknown : app/bsky/jetstream/SubscribeKind {
public fun <init> (Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeKind$Unknown;
public static synthetic fun copy$default (Lapp/bsky/jetstream/SubscribeKind$Unknown;Ljava/lang/String;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeKind$Unknown;
public fun equals (Ljava/lang/Object;)Z
public final fun getRawValue ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeKindSerializer : kotlinx/serialization/KSerializer {
public fun <init> ()V
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lapp/bsky/jetstream/SubscribeKind;
Expand All @@ -144,8 +159,8 @@ public abstract class app/bsky/jetstream/SubscribeOperation : sh/christian/ozone
}

public final class app/bsky/jetstream/SubscribeOperation$Companion {
public final fun safeValueOf (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeOperation;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
public final fun unsafeValueOf (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeOperation;
}

public final class app/bsky/jetstream/SubscribeOperation$Create : app/bsky/jetstream/SubscribeOperation {
Expand All @@ -162,6 +177,17 @@ public final class app/bsky/jetstream/SubscribeOperation$Delete : app/bsky/jetst
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeOperation$Unknown : app/bsky/jetstream/SubscribeOperation {
public fun <init> (Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeOperation$Unknown;
public static synthetic fun copy$default (Lapp/bsky/jetstream/SubscribeOperation$Unknown;Ljava/lang/String;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeOperation$Unknown;
public fun equals (Ljava/lang/Object;)Z
public final fun getRawValue ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeOperation$Update : app/bsky/jetstream/SubscribeOperation {
public static final field INSTANCE Lapp/bsky/jetstream/SubscribeOperation$Update;
public fun equals (Ljava/lang/Object;)Z
Expand Down Expand Up @@ -247,6 +273,65 @@ public final class app/bsky/jetstream/SubscribeSourcedMessage$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public abstract class app/bsky/jetstream/SubscribeStatus : sh/christian/ozone/api/model/AtpEnum {
public static final field Companion Lapp/bsky/jetstream/SubscribeStatus$Companion;
public synthetic fun <init> (Ljava/lang/String;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getValue ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeStatus$Companion {
public final fun safeValueOf (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeStatus;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class app/bsky/jetstream/SubscribeStatus$Deactivated : app/bsky/jetstream/SubscribeStatus {
public static final field INSTANCE Lapp/bsky/jetstream/SubscribeStatus$Deactivated;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeStatus$Deleted : app/bsky/jetstream/SubscribeStatus {
public static final field INSTANCE Lapp/bsky/jetstream/SubscribeStatus$Deleted;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeStatus$Suspended : app/bsky/jetstream/SubscribeStatus {
public static final field INSTANCE Lapp/bsky/jetstream/SubscribeStatus$Suspended;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeStatus$Takendown : app/bsky/jetstream/SubscribeStatus {
public static final field INSTANCE Lapp/bsky/jetstream/SubscribeStatus$Takendown;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeStatus$Unknown : app/bsky/jetstream/SubscribeStatus {
public fun <init> (Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
public final fun copy (Ljava/lang/String;)Lapp/bsky/jetstream/SubscribeStatus$Unknown;
public static synthetic fun copy$default (Lapp/bsky/jetstream/SubscribeStatus$Unknown;Ljava/lang/String;ILjava/lang/Object;)Lapp/bsky/jetstream/SubscribeStatus$Unknown;
public fun equals (Ljava/lang/Object;)Z
public final fun getRawValue ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class app/bsky/jetstream/SubscribeStatusSerializer : kotlinx/serialization/KSerializer {
public fun <init> ()V
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Lapp/bsky/jetstream/SubscribeStatus;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public fun serialize (Lkotlinx/serialization/encoding/Encoder;Lapp/bsky/jetstream/SubscribeStatus;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
}

public final class sh/christian/ozone/jetstream/JetstreamApi : sh/christian/ozone/jetstream/JetstreamInterface {
public fun <init> ()V
public fun <init> (Lio/ktor/client/HttpClient;)V
Expand Down
6 changes: 6 additions & 0 deletions jetstream/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ dependencies {
})
}

lexicons {
defaults {
generateUnknownsForEnums.set(true)
}
}

kotlin {
sourceSets {
val commonMain by getting {
Expand Down
37 changes: 21 additions & 16 deletions jetstream/schemas/app/bsky/jetstream/subscribe.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,31 +112,36 @@
},
"identity": {
"type": "object",
"required": ["did", "handle", "seq", "time"],
"description": "Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.",
"required": ["seq", "did", "time"],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"seq": { "type": "integer" },
"did": { "type": "string", "format": "did" },
"time": { "type": "string", "format": "datetime" },
"handle": {
"type": "string",
"format": "handle"
},
"seq": { "type": "integer" },
"time": { "type": "string" }
"format": "handle",
"description": "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details."
}
}
},
"account": {
"type": "object",
"required": ["active", "did", "seq", "time"],
"description": "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.",
"required": ["seq", "did", "time", "active"],
"properties": {
"active": { "type": "boolean" },
"did": {
"type": "string",
"format": "did"
},
"seq": { "type": "integer" },
"time": { "type": "string" }
"did": { "type": "string", "format": "did" },
"time": { "type": "string", "format": "datetime" },
"active": {
"type": "boolean",
"description": "Indicates that the account has a repository which can be fetched from the host that emitted this event."
},
"status": {
"type": "string",
"description": "If active=false, this optional field indicates a reason for why the account is not active.",
"knownValues": ["takendown", "suspended", "deleted", "deactivated"]
}
}
},
"sourcedMessage": {
Expand Down

0 comments on commit 688479b

Please sign in to comment.