mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 19:57:04 +05:30
feat(api/model): initial Shiori API
This commit is contained in:
parent
f55d89b17e
commit
f39bf0b043
9 changed files with 212 additions and 0 deletions
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright © 2021-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class Account(
|
||||
val id: Int,
|
||||
val username: String,
|
||||
val owner: Boolean,
|
||||
)
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright © 2021-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class AuthRequest(
|
||||
val username: String,
|
||||
val password: String,
|
||||
val remember: Boolean = true,
|
||||
val owner: Boolean = false,
|
||||
)
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright © 2022-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class AuthResponse(
|
||||
val session: String,
|
||||
val expires: String,
|
||||
val account: Account,
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright © 2021-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class Bookmark(
|
||||
val id: Int,
|
||||
val url: String,
|
||||
val title: String,
|
||||
val excerpt: String,
|
||||
val author: String,
|
||||
val public: Int,
|
||||
val modified: String,
|
||||
val imageURL: String,
|
||||
val hasContent: Boolean,
|
||||
val hasArchive: Boolean,
|
||||
val tags: List<Tag>,
|
||||
val createArchive: Boolean,
|
||||
)
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright © 2021-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class BookmarkRequest(
|
||||
val url: String,
|
||||
val createArchive: Boolean,
|
||||
val public: Int,
|
||||
val tags: List<Tag>,
|
||||
val title: String,
|
||||
val excerpt: String,
|
||||
)
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright © 2022-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class BookmarksResponse(
|
||||
val bookmarks: List<Bookmark>,
|
||||
val maxPage: Int,
|
||||
val page: Int,
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright © 2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@Poko
|
||||
class EditedBookmark(
|
||||
val id: Int,
|
||||
val url: String? = null,
|
||||
val title: String? = null,
|
||||
val excerpt: String? = null,
|
||||
val author: String? = null,
|
||||
val public: Int? = null,
|
||||
val modified: String? = null,
|
||||
val imageURL: String? = null,
|
||||
val hasContent: Boolean? = null,
|
||||
val hasArchive: Boolean? = null,
|
||||
val tags: List<Tag>? = null,
|
||||
val createArchive: Boolean? = null,
|
||||
)
|
12
model/src/main/kotlin/dev/msfjarvis/claw/model/shiori/Tag.kt
Normal file
12
model/src/main/kotlin/dev/msfjarvis/claw/model/shiori/Tag.kt
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Copyright © 2022-2023 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
package dev.msfjarvis.claw.model.shiori
|
||||
|
||||
import dev.drewhamilton.poko.Poko
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable @Poko class Tag(val name: String)
|
Loading…
Add table
Add a link
Reference in a new issue