Skip to content

Commit

Permalink
preparing for impl dm.
Browse files Browse the repository at this point in the history
  • Loading branch information
uakihir0 committed Jun 24, 2024
1 parent 1fd1c69 commit 2d265fe
Show file tree
Hide file tree
Showing 275 changed files with 1,078 additions and 913 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.iml
.idea
.gradle
.kotlin
target/
build/
out/
Expand Down
6 changes: 3 additions & 3 deletions core/src/commonMain/kotlin/work/socialhub/kbsky/ATProtocol.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package work.socialhub.kbsky

import work.socialhub.kbsky.api.atproto.IdentityResource
import work.socialhub.kbsky.api.atproto.RepoResource
import work.socialhub.kbsky.api.atproto.ServerResource
import work.socialhub.kbsky.api.com.atproto.IdentityResource
import work.socialhub.kbsky.api.com.atproto.RepoResource
import work.socialhub.kbsky.api.com.atproto.ServerResource

interface ATProtocol {
fun identity(): IdentityResource
Expand Down
6 changes: 5 additions & 1 deletion core/src/commonMain/kotlin/work/socialhub/kbsky/Bluesky.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package work.socialhub.kbsky

import work.socialhub.kbsky.api.bsky.*
import work.socialhub.kbsky.api.app.bsky.ActorResource
import work.socialhub.kbsky.api.app.bsky.FeedResource
import work.socialhub.kbsky.api.app.bsky.GraphResource
import work.socialhub.kbsky.api.app.bsky.NotificationResource
import work.socialhub.kbsky.api.app.bsky.UnspeccedResource

interface Bluesky : ATProtocol {
fun actor(): ActorResource
Expand Down
21 changes: 21 additions & 0 deletions core/src/commonMain/kotlin/work/socialhub/kbsky/BlueskyTypes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ package work.socialhub.kbsky
*/
object BlueskyTypes {

/// ----------------------------------------------------------------------- ///
/// APP.BLUESKY
/// ----------------------------------------------------------------------- ///

// Actor
const val ActorDefs = "app.bsky.actor.defs"
const val ActorProfile = "app.bsky.actor.profile"
Expand Down Expand Up @@ -67,4 +71,21 @@ object BlueskyTypes {

// Unspecced
const val UnspeccedGetPopular = "app.bsky.unspecced.getPopular"

/// ----------------------------------------------------------------------- ///
/// CHAT.BLUESKY
/// ----------------------------------------------------------------------- ///

// Convo
const val ConvoDeleteMessageForSelf = "chat.bsky.convo.deleteMessageForSelf"
const val ConvoGetConvo = "chat.bsky.convo.getConvo"
const val ConvoGetConvoForMembers = "chat.bsky.convo.getConvoForMembers"
const val ConvoGetLog = "chat.bsky.convo.getLog"
const val ConvoGetMessages = "chat.bsky.convo.getMessages"
const val ConvoLeaveConvo = "chat.bsky.convo.leaveConvo"
const val ConvoListConvos = "chat.bsky.convo.listConvos"
const val ConvoMuteConvo = "chat.bsky.convo.muteConvo"
const val ConvoSendMessageBatch = "chat.bsky.convo.sendMessageBatch"
const val ConvoUnmuteConvo = "chat.bsky.convo.unmuteConvo"
const val ConvoUpdateRead = "chat.bsky.convo.updateRead"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package work.socialhub.kbsky.api.bsky
package work.socialhub.kbsky.api.app.bsky

import work.socialhub.kbsky.api.entity.bsky.actor.*
import work.socialhub.kbsky.api.entity.app.bsky.actor.*
import work.socialhub.kbsky.api.entity.share.Response

interface ActorResource {
Expand All @@ -16,7 +16,7 @@ interface ActorResource {
* Get detailed profile view of an actor.
*/
fun getProfile(
request: ActorGetProfileRequest
request: work.socialhub.kbsky.api.entity.app.bsky.actor.ActorGetProfileRequest
): Response<ActorGetProfileResponse>

/**
Expand All @@ -37,6 +37,6 @@ interface ActorResource {
* Get private preferences attached to the account.
*/
fun getPreferences(
request: ActorGetPreferencesRequest
): Response<ActorGetPreferencesResponse>
request: work.socialhub.kbsky.api.entity.app.bsky.actor.ActorGetPreferencesRequest
): Response<work.socialhub.kbsky.api.entity.app.bsky.actor.ActorGetPreferencesResponse>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package work.socialhub.kbsky.api.bsky
package work.socialhub.kbsky.api.app.bsky

import work.socialhub.kbsky.api.entity.bsky.feed.*
import work.socialhub.kbsky.api.entity.app.bsky.feed.*
import work.socialhub.kbsky.api.entity.share.Response

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package work.socialhub.kbsky.api.bsky
package work.socialhub.kbsky.api.app.bsky

import work.socialhub.kbsky.api.entity.bsky.graph.*
import work.socialhub.kbsky.api.entity.app.bsky.graph.*
import work.socialhub.kbsky.api.entity.share.Response

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package work.socialhub.kbsky.api.bsky
package work.socialhub.kbsky.api.app.bsky

import work.socialhub.kbsky.api.entity.bsky.notification.*
import work.socialhub.kbsky.api.entity.app.bsky.notification.*
import work.socialhub.kbsky.api.entity.share.Response


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.bsky
package work.socialhub.kbsky.api.app.bsky

import work.socialhub.kbsky.api.entity.bsky.unspecced.UnspeccedGetPopularRequest
import work.socialhub.kbsky.api.entity.bsky.unspecced.UnspeccedGetPopularResponse
import work.socialhub.kbsky.api.entity.app.bsky.unspecced.UnspeccedGetPopularRequest
import work.socialhub.kbsky.api.entity.app.bsky.unspecced.UnspeccedGetPopularResponse
import work.socialhub.kbsky.api.entity.share.Response


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package work.socialhub.kbsky.api.chat.bsky

import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoGetConvoForMembersRequest
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoGetConvoForMembersResponse
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoGetConvoRequest
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoGetConvoResponse
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoGetLogRequest
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoGetLogResponse
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoLeaveConvoRequest
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoLeaveConvoResponse
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoListConvosRequest
import work.socialhub.kbsky.api.entity.chat.bsky.convo.ConvoListConvosResponse
import work.socialhub.kbsky.api.entity.share.Response

interface ConvoResource {

/**
*
*/
fun getConvo(
request: ConvoGetConvoRequest
): Response<ConvoGetConvoResponse>

/**
*
*/
fun getConvoForMembers(
request: ConvoGetConvoForMembersRequest
): Response<ConvoGetConvoForMembersResponse>

/**
*
*/
fun getLog(
request: ConvoGetLogRequest
): Response<ConvoGetLogResponse>

fun leaveConvo(
request: ConvoLeaveConvoRequest
): Response<ConvoLeaveConvoResponse>

fun listConvos(
request: ConvoListConvosRequest
): Response<ConvoListConvosResponse>
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.atproto
package work.socialhub.kbsky.api.com.atproto

import work.socialhub.kbsky.api.entity.atproto.identity.IdentityResolveHandleRequest
import work.socialhub.kbsky.api.entity.atproto.identity.IdentityResolveHandleResponse
import work.socialhub.kbsky.api.entity.com.atproto.identity.IdentityResolveHandleRequest
import work.socialhub.kbsky.api.entity.com.atproto.identity.IdentityResolveHandleResponse
import work.socialhub.kbsky.api.entity.share.Response

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package work.socialhub.kbsky.api.atproto
package work.socialhub.kbsky.api.com.atproto

import work.socialhub.kbsky.api.entity.atproto.repo.*
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoCreateRecordRequest
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoCreateRecordResponse
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoDeleteRecordRequest
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoGetRecordRequest
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoGetRecordResponse
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoListRecordsRequest
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoListRecordsResponse
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoPutRecordRequest
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoPutRecordResponse
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoUploadBlobRequest
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoUploadBlobResponse
import work.socialhub.kbsky.api.entity.share.Response

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package work.socialhub.kbsky.api.atproto
package work.socialhub.kbsky.api.com.atproto

import work.socialhub.kbsky.api.entity.atproto.server.ServerCreateSessionRequest
import work.socialhub.kbsky.api.entity.atproto.server.ServerCreateSessionResponse
import work.socialhub.kbsky.api.entity.atproto.server.ServerGetSessionResponse
import work.socialhub.kbsky.api.entity.atproto.server.ServerRefreshSessionResponse
import work.socialhub.kbsky.api.entity.com.atproto.server.ServerCreateSessionRequest
import work.socialhub.kbsky.api.entity.com.atproto.server.ServerCreateSessionResponse
import work.socialhub.kbsky.api.entity.com.atproto.server.ServerGetSessionResponse
import work.socialhub.kbsky.api.entity.com.atproto.server.ServerRefreshSessionResponse
import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.Response

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.bsky.actor.ActorDefsPreferencesUnion
import work.socialhub.kbsky.model.app.bsky.actor.ActorDefsPreferencesUnion

@Serializable
class ActorGetPreferencesResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package work.socialhub.kbsky.api.entity.app.bsky.actor

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.app.bsky.actor.ActorDefsProfileViewDetailed

@Serializable
class ActorGetProfileResponse : ActorDefsProfileViewDetailed()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.bsky.actor.ActorDefsProfileViewDetailed
import work.socialhub.kbsky.model.app.bsky.actor.ActorDefsProfileViewDetailed

@Serializable
class ActorGetProfilesResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.bsky.actor.ActorDefsProfileView
import work.socialhub.kbsky.model.app.bsky.actor.ActorDefsProfileView

@Serializable
class ActorSearchActorsResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.actor
package work.socialhub.kbsky.api.entity.app.bsky.actor

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.model.share.Blob
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package work.socialhub.kbsky.api.entity.app.bsky.actor

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.api.entity.com.atproto.repo.RepoPutRecordResponse

@Serializable
class ActorUpdateProfileResponse : RepoPutRecordResponse()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.RKeyRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.RKeyRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.RKeyRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.bsky.feed.FeedDefsGeneratorView
import work.socialhub.kbsky.model.app.bsky.feed.FeedDefsGeneratorView

@Serializable
class FeedGetActorFeedsResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.bsky.feed.FeedDefsFeedViewPost
import work.socialhub.kbsky.model.app.bsky.feed.FeedDefsFeedViewPost

@Serializable
class FeedGetActorLikesResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.bsky.feed.FeedDefsFeedViewPost
import work.socialhub.kbsky.model.app.bsky.feed.FeedDefsFeedViewPost

@Serializable
class FeedGetAuthorFeedResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package work.socialhub.kbsky.api.entity.app.bsky.feed

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.app.bsky.feed.FeedDefsGeneratorView

@Serializable
class FeedGetFeedGeneratorResponse {
var view: work.socialhub.kbsky.model.app.bsky.feed.FeedDefsGeneratorView? = null
var online: Boolean? = null
var valid: Boolean? = null
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package work.socialhub.kbsky.api.entity.bsky.feed
package work.socialhub.kbsky.api.entity.app.bsky.feed

import work.socialhub.kbsky.api.entity.share.AuthRequest
import work.socialhub.kbsky.api.entity.share.MapRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package work.socialhub.kbsky.api.entity.app.bsky.feed

import kotlinx.serialization.Serializable
import work.socialhub.kbsky.model.app.bsky.feed.FeedDefsGeneratorView

@Serializable
class FeedGetFeedGeneratorsResponse {
lateinit var feeds: List<work.socialhub.kbsky.model.app.bsky.feed.FeedDefsGeneratorView>
}
Loading

0 comments on commit 2d265fe

Please sign in to comment.