* Adding typescript generation for API. Fixes #2824 * Try to fix Ltree issue 1. * Forgot a few types. * Fixing api tests. * Removing url_serde line. * Manually deriving TS for some types.
This commit is contained in:
parent
1b5437cbe3
commit
88a0d2feec
54 changed files with 1329 additions and 183 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -23,3 +23,6 @@ api_tests/yalc.lock
|
||||||
|
|
||||||
# pictrs data
|
# pictrs data
|
||||||
pictrs/
|
pictrs/
|
||||||
|
|
||||||
|
# The generated typescript bindings
|
||||||
|
bindings
|
||||||
|
|
463
Cargo.lock
generated
463
Cargo.lock
generated
|
@ -2,6 +2,16 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "Inflector"
|
||||||
|
version = "0.11.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
"regex",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "activitypub_federation"
|
name = "activitypub_federation"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
@ -401,6 +411,20 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ast_node"
|
||||||
|
version = "0.8.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "70151a5226578411132d798aa248df45b30aa34aea2e580628870b4d87be717b"
|
||||||
|
dependencies = [
|
||||||
|
"darling 0.13.4",
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"swc_macros_common",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-mutex"
|
name = "async-mutex"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
|
@ -629,6 +653,15 @@ dependencies = [
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "better_scoped_tls"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b73e8ecdec39e98aa3b19e8cd0b8ed8f77ccb86a6b0b2dc7cd86d105438a2123"
|
||||||
|
dependencies = [
|
||||||
|
"scoped-tls",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bit-set"
|
name = "bit-set"
|
||||||
version = "0.5.3"
|
version = "0.5.3"
|
||||||
|
@ -884,7 +917,7 @@ dependencies = [
|
||||||
"pest_derive",
|
"pest_derive",
|
||||||
"regex",
|
"regex",
|
||||||
"shell-words",
|
"shell-words",
|
||||||
"typed-arena",
|
"typed-arena 1.7.0",
|
||||||
"unicode_categories",
|
"unicode_categories",
|
||||||
"xdg",
|
"xdg",
|
||||||
]
|
]
|
||||||
|
@ -1227,6 +1260,30 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "debug_unreachable"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9a032eac705ca39214d169f83e3d3da290af06d8d1d344d1baad2fd002dca4b3"
|
||||||
|
dependencies = [
|
||||||
|
"unreachable",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "deno_ast"
|
||||||
|
version = "0.20.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "322f52615649f4f096eed78ec8e2a7eb68ff0bf5f330d59302c5479c7a8fa158"
|
||||||
|
dependencies = [
|
||||||
|
"dprint-swc-ext",
|
||||||
|
"serde",
|
||||||
|
"swc_atoms",
|
||||||
|
"swc_common",
|
||||||
|
"swc_ecma_ast",
|
||||||
|
"swc_ecma_parser",
|
||||||
|
"text_lines",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_builder"
|
name = "derive_builder"
|
||||||
version = "0.10.2"
|
version = "0.10.2"
|
||||||
|
@ -1477,6 +1534,48 @@ dependencies = [
|
||||||
"syn 1.0.103",
|
"syn 1.0.103",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dprint-core"
|
||||||
|
version = "0.59.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "84600c297cc99fc088a9a916286d71915c988fa3a6f1bbc994ad9b93dde80c03"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"bumpalo",
|
||||||
|
"indexmap",
|
||||||
|
"rustc-hash",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dprint-plugin-typescript"
|
||||||
|
version = "0.77.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0e301864e67893077d67258287d90441e8b22fa5e571bd31f9b43c5de10db546"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"deno_ast",
|
||||||
|
"dprint-core",
|
||||||
|
"rustc-hash",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dprint-swc-ext"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f8ac3ba92d2cf3b87b8f48551d1720ff63a134545c830476aaffd8cf9d80e84e"
|
||||||
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"num-bigint",
|
||||||
|
"rustc-hash",
|
||||||
|
"swc_atoms",
|
||||||
|
"swc_common",
|
||||||
|
"swc_ecma_ast",
|
||||||
|
"swc_ecma_parser",
|
||||||
|
"text_lines",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dyn-clone"
|
name = "dyn-clone"
|
||||||
version = "1.0.9"
|
version = "1.0.9"
|
||||||
|
@ -1608,6 +1707,18 @@ dependencies = [
|
||||||
"syn 1.0.103",
|
"syn 1.0.103",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "enum_kind"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9895954c6ec59d897ed28a64815f2ceb57653fcaaebd317f2edc78b74f5495b6"
|
||||||
|
dependencies = [
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"swc_macros_common",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "errno"
|
name = "errno"
|
||||||
version = "0.2.8"
|
version = "0.2.8"
|
||||||
|
@ -1715,6 +1826,18 @@ dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "from_variant"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1d449976075322384507443937df2f1d5577afbf4282f12a5a66ef29fa3e6307"
|
||||||
|
dependencies = [
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"swc_macros_common",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fs2"
|
name = "fs2"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
|
@ -2263,6 +2386,7 @@ checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2299,6 +2423,19 @@ version = "2.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b"
|
checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-macro"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8a7d079e129b77477a49c5c4f1cfe9ce6c2c909ef52520693e8e811a714c7b20"
|
||||||
|
dependencies = [
|
||||||
|
"Inflector",
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is-terminal"
|
name = "is-terminal"
|
||||||
version = "0.4.2"
|
version = "0.4.2"
|
||||||
|
@ -2440,9 +2577,11 @@ dependencies = [
|
||||||
"rosetta-i18n",
|
"rosetta-i18n",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"serde_with",
|
||||||
"strum",
|
"strum",
|
||||||
"strum_macros",
|
"strum_macros",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"ts-rs",
|
||||||
"url",
|
"url",
|
||||||
"uuid",
|
"uuid",
|
||||||
"webpage",
|
"webpage",
|
||||||
|
@ -2526,12 +2665,14 @@ dependencies = [
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"serde_with",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
"sha2",
|
"sha2",
|
||||||
"strum",
|
"strum",
|
||||||
"strum_macros",
|
"strum_macros",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"ts-rs",
|
||||||
"typed-builder",
|
"typed-builder",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
@ -2545,9 +2686,11 @@ dependencies = [
|
||||||
"diesel_ltree",
|
"diesel_ltree",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_with",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"ts-rs",
|
||||||
"typed-builder",
|
"typed-builder",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2559,6 +2702,8 @@ dependencies = [
|
||||||
"diesel-async",
|
"diesel-async",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_with",
|
||||||
|
"ts-rs",
|
||||||
"typed-builder",
|
"typed-builder",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2570,6 +2715,8 @@ dependencies = [
|
||||||
"diesel-async",
|
"diesel-async",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_with",
|
||||||
|
"ts-rs",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2699,6 +2846,15 @@ dependencies = [
|
||||||
"socket2",
|
"socket2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical"
|
||||||
|
version = "6.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c7aefb36fd43fef7003334742cbf77b243fcd36418a1d1bdd480d613a67968f6"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-core 0.8.5",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lexical-core"
|
name = "lexical-core"
|
||||||
version = "0.7.6"
|
version = "0.7.6"
|
||||||
|
@ -2712,6 +2868,70 @@ dependencies = [
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-core"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-parse-float",
|
||||||
|
"lexical-parse-integer",
|
||||||
|
"lexical-util",
|
||||||
|
"lexical-write-float",
|
||||||
|
"lexical-write-integer",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-parse-float"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-parse-integer",
|
||||||
|
"lexical-util",
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-parse-integer"
|
||||||
|
version = "0.8.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-util",
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-util"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc"
|
||||||
|
dependencies = [
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-write-float"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-util",
|
||||||
|
"lexical-write-integer",
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lexical-write-integer"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446"
|
||||||
|
dependencies = [
|
||||||
|
"lexical-util",
|
||||||
|
"static_assertions",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.135"
|
version = "0.2.135"
|
||||||
|
@ -3003,7 +3223,7 @@ checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitvec",
|
"bitvec",
|
||||||
"funty",
|
"funty",
|
||||||
"lexical-core",
|
"lexical-core 0.7.6",
|
||||||
"memchr",
|
"memchr",
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
@ -3037,6 +3257,7 @@ dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3627,6 +3848,17 @@ version = "0.3.25"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
|
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pmutil"
|
||||||
|
version = "0.5.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "png"
|
name = "png"
|
||||||
version = "0.17.6"
|
version = "0.17.6"
|
||||||
|
@ -4234,6 +4466,12 @@ version = "0.1.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
|
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc-hash"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
@ -4319,6 +4557,12 @@ dependencies = [
|
||||||
"windows-sys 0.36.1",
|
"windows-sys 0.36.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scoped-tls"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -4605,6 +4849,12 @@ version = "0.5.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stable_deref_trait"
|
||||||
|
version = "1.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "static_assertions"
|
name = "static_assertions"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -4643,6 +4893,19 @@ dependencies = [
|
||||||
"quote 1.0.21",
|
"quote 1.0.21",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "string_enum"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "91f42363e5ca94ea6f3faee9e3b5e1a4047535ae323f5c0579385fb2ae95874e"
|
||||||
|
dependencies = [
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"swc_macros_common",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stringprep"
|
name = "stringprep"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
|
@ -4684,6 +4947,131 @@ version = "2.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
|
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_atoms"
|
||||||
|
version = "0.4.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "01b878052680dcec3421ab50384279443dbf93651b05da38e5133e0894a18096"
|
||||||
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
|
"rustc-hash",
|
||||||
|
"serde",
|
||||||
|
"string_cache",
|
||||||
|
"string_cache_codegen",
|
||||||
|
"triomphe",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_common"
|
||||||
|
version = "0.29.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ebd844dfbd9969a9ef8430e954661de43edde353d65e987f935a328619698883"
|
||||||
|
dependencies = [
|
||||||
|
"ahash",
|
||||||
|
"ast_node",
|
||||||
|
"better_scoped_tls",
|
||||||
|
"cfg-if",
|
||||||
|
"debug_unreachable",
|
||||||
|
"either",
|
||||||
|
"from_variant",
|
||||||
|
"num-bigint",
|
||||||
|
"once_cell",
|
||||||
|
"rustc-hash",
|
||||||
|
"serde",
|
||||||
|
"siphasher",
|
||||||
|
"string_cache",
|
||||||
|
"swc_atoms",
|
||||||
|
"swc_eq_ignore_macros",
|
||||||
|
"swc_visit",
|
||||||
|
"tracing",
|
||||||
|
"unicode-width",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_ecma_ast"
|
||||||
|
version = "0.94.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2c3303de79adce1137e6514e5939686173e7d26c71d91c3067056caa45183547"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"is-macro",
|
||||||
|
"num-bigint",
|
||||||
|
"scoped-tls",
|
||||||
|
"serde",
|
||||||
|
"string_enum",
|
||||||
|
"swc_atoms",
|
||||||
|
"swc_common",
|
||||||
|
"unicode-id",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_ecma_parser"
|
||||||
|
version = "0.122.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8cec064f10003ea47bd5e97d6456a683643da9f705670b97eb1c90bc434f58f3"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
"enum_kind",
|
||||||
|
"lexical",
|
||||||
|
"num-bigint",
|
||||||
|
"serde",
|
||||||
|
"smallvec",
|
||||||
|
"swc_atoms",
|
||||||
|
"swc_common",
|
||||||
|
"swc_ecma_ast",
|
||||||
|
"tracing",
|
||||||
|
"typed-arena 2.0.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_eq_ignore_macros"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0c20468634668c2bbab581947bb8c75c97158d5a6959f4ba33df20983b20b4f6"
|
||||||
|
dependencies = [
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_macros_common"
|
||||||
|
version = "0.3.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3e582c3e3c2269238524923781df5be49e011dbe29cf7683a2215d600a562ea6"
|
||||||
|
dependencies = [
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_visit"
|
||||||
|
version = "0.5.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d1d5999f23421c8e21a0f2bc53a0b9e8244f3b421de89471561af2fbe40b9cca"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
"swc_visit_macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "swc_visit_macros"
|
||||||
|
version = "0.5.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ebeed7eb0f545f48ad30f5aab314e5208b735bcea1d1464f26e20f06db904989"
|
||||||
|
dependencies = [
|
||||||
|
"Inflector",
|
||||||
|
"pmutil",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"swc_macros_common",
|
||||||
|
"syn 1.0.103",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "0.14.9"
|
version = "0.14.9"
|
||||||
|
@ -4761,6 +5149,15 @@ dependencies = [
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "text_lines"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7fd5828de7deaa782e1dd713006ae96b3bee32d3279b79eb67ecf8072c059bcf"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.37"
|
version = "1.0.37"
|
||||||
|
@ -5311,12 +5708,47 @@ dependencies = [
|
||||||
"tracing-serde",
|
"tracing-serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "triomphe"
|
||||||
|
version = "0.1.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"stable_deref_trait",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "try-lock"
|
name = "try-lock"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
|
checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ts-rs"
|
||||||
|
version = "6.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4added4070a4fdf9df03457206cd2e4b12417c8560a2954d91ffcbe60177a56a"
|
||||||
|
dependencies = [
|
||||||
|
"chrono",
|
||||||
|
"dprint-plugin-typescript",
|
||||||
|
"thiserror",
|
||||||
|
"ts-rs-macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ts-rs-macros"
|
||||||
|
version = "6.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9f807fdb3151fee75df7485b901a89624358cd07a67a8fb1a5831bf5a07681ff"
|
||||||
|
dependencies = [
|
||||||
|
"Inflector",
|
||||||
|
"proc-macro2 1.0.47",
|
||||||
|
"quote 1.0.21",
|
||||||
|
"syn 1.0.103",
|
||||||
|
"termcolor",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "twoway"
|
name = "twoway"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
|
@ -5333,6 +5765,12 @@ version = "1.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"
|
checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typed-arena"
|
||||||
|
version = "2.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typed-builder"
|
name = "typed-builder"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
|
@ -5377,6 +5815,12 @@ version = "0.3.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
|
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-id"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.5"
|
version = "1.0.5"
|
||||||
|
@ -5416,6 +5860,15 @@ version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
|
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unreachable"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91"
|
||||||
|
dependencies = [
|
||||||
|
"void",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "untrusted"
|
name = "untrusted"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
|
@ -5474,6 +5927,12 @@ version = "0.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "void"
|
||||||
|
version = "1.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
version = "2.3.2"
|
version = "2.3.2"
|
||||||
|
|
|
@ -64,6 +64,7 @@ diesel = "2.0.2"
|
||||||
diesel_migrations = "2.0.0"
|
diesel_migrations = "2.0.0"
|
||||||
diesel-async = "0.1.1"
|
diesel-async = "0.1.1"
|
||||||
serde = { version = "1.0.147", features = ["derive"] }
|
serde = { version = "1.0.147", features = ["derive"] }
|
||||||
|
serde_with = "1.14.0"
|
||||||
actix-web = { version = "4.2.1", default-features = false, features = ["macros", "rustls"] }
|
actix-web = { version = "4.2.1", default-features = false, features = ["macros", "rustls"] }
|
||||||
tracing = "0.1.36"
|
tracing = "0.1.36"
|
||||||
tracing-actix-web = { version = "0.6.1", default-features = false }
|
tracing-actix-web = { version = "0.6.1", default-features = false }
|
||||||
|
@ -71,6 +72,7 @@ tracing-error = "0.2.0"
|
||||||
tracing-log = "0.1.3"
|
tracing-log = "0.1.3"
|
||||||
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
|
||||||
url = { version = "2.3.1", features = ["serde"] }
|
url = { version = "2.3.1", features = ["serde"] }
|
||||||
|
url_serde = "0.2.0"
|
||||||
reqwest = { version = "0.11.12", features = ["json", "blocking"] }
|
reqwest = { version = "0.11.12", features = ["json", "blocking"] }
|
||||||
reqwest-middleware = "0.2.0"
|
reqwest-middleware = "0.2.0"
|
||||||
reqwest-tracing = "0.4.0"
|
reqwest-tracing = "0.4.0"
|
||||||
|
@ -106,6 +108,7 @@ rand = "0.8.5"
|
||||||
opentelemetry = { version = "0.17.0", features = ["rt-tokio"] }
|
opentelemetry = { version = "0.17.0", features = ["rt-tokio"] }
|
||||||
tracing-opentelemetry = { version = "0.17.2" }
|
tracing-opentelemetry = { version = "0.17.2" }
|
||||||
actix = "0.13"
|
actix = "0.13"
|
||||||
|
ts-rs = { version = "6.2", features = ["serde-compat", "format", "chrono-impl"] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_api = { workspace = true }
|
lemmy_api = { workspace = true }
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
"eslint": "^8.25.0",
|
"eslint": "^8.25.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^27.0.6",
|
"jest": "^27.0.6",
|
||||||
"lemmy-js-client": "0.17.2-rc.6",
|
"lemmy-js-client": "0.17.2-rc.11",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"ts-jest": "^27.0.3",
|
"ts-jest": "^27.0.3",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
jest.setTimeout(180000);
|
jest.setTimeout(180000);
|
||||||
import { CommentView } from "lemmy-js-client";
|
|
||||||
import { PostResponse } from "lemmy-js-client";
|
|
||||||
|
|
||||||
|
import { PostResponse } from "lemmy-js-client/dist/types/PostResponse";
|
||||||
import {
|
import {
|
||||||
alpha,
|
alpha,
|
||||||
beta,
|
beta,
|
||||||
|
@ -31,6 +30,7 @@ import {
|
||||||
getCommentParentId,
|
getCommentParentId,
|
||||||
resolveCommunity,
|
resolveCommunity,
|
||||||
} from "./shared";
|
} from "./shared";
|
||||||
|
import { CommentView } from "lemmy-js-client/dist/types/CommentView";
|
||||||
|
|
||||||
let postRes: PostResponse;
|
let postRes: PostResponse;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
jest.setTimeout(120000);
|
jest.setTimeout(120000);
|
||||||
import { CommunityView } from "lemmy-js-client";
|
|
||||||
|
|
||||||
|
import { CommunityView } from "lemmy-js-client/dist/types/CommunityView";
|
||||||
import {
|
import {
|
||||||
alpha,
|
alpha,
|
||||||
beta,
|
beta,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
jest.setTimeout(120000);
|
jest.setTimeout(120000);
|
||||||
import { SubscribedType } from "lemmy-js-client";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
alpha,
|
alpha,
|
||||||
|
@ -29,7 +28,7 @@ test("Follow federated community", async () => {
|
||||||
// Make sure the follow response went through
|
// Make sure the follow response went through
|
||||||
expect(betaCommunity?.community.local).toBe(false);
|
expect(betaCommunity?.community.local).toBe(false);
|
||||||
expect(betaCommunity?.community.name).toBe("main");
|
expect(betaCommunity?.community.name).toBe("main");
|
||||||
expect(betaCommunity?.subscribed).toBe(SubscribedType.Subscribed);
|
expect(betaCommunity?.subscribed).toBe("Subscribed");
|
||||||
|
|
||||||
// Check it from local
|
// Check it from local
|
||||||
let site = await getSite(alpha);
|
let site = await getSite(alpha);
|
||||||
|
@ -45,7 +44,7 @@ test("Follow federated community", async () => {
|
||||||
|
|
||||||
// Test an unfollow
|
// Test an unfollow
|
||||||
let unfollow = await followCommunity(alpha, false, remoteCommunityId);
|
let unfollow = await followCommunity(alpha, false, remoteCommunityId);
|
||||||
expect(unfollow.community_view.subscribed).toBe(SubscribedType.NotSubscribed);
|
expect(unfollow.community_view.subscribed).toBe("NotSubscribed");
|
||||||
|
|
||||||
// Make sure you are unsubbed locally
|
// Make sure you are unsubbed locally
|
||||||
let siteUnfollowCheck = await getSite(alpha);
|
let siteUnfollowCheck = await getSite(alpha);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
jest.setTimeout(120000);
|
jest.setTimeout(120000);
|
||||||
import { PostView, CommunityView } from "lemmy-js-client";
|
|
||||||
|
|
||||||
|
import { CommunityView } from "lemmy-js-client/dist/types/CommunityView";
|
||||||
import {
|
import {
|
||||||
alpha,
|
alpha,
|
||||||
beta,
|
beta,
|
||||||
|
@ -35,6 +35,7 @@ import {
|
||||||
unfollows,
|
unfollows,
|
||||||
resolveCommunity,
|
resolveCommunity,
|
||||||
} from "./shared";
|
} from "./shared";
|
||||||
|
import { PostView } from "lemmy-js-client/dist/types/PostView";
|
||||||
|
|
||||||
let betaCommunity: CommunityView | undefined;
|
let betaCommunity: CommunityView | undefined;
|
||||||
|
|
||||||
|
|
|
@ -1,71 +1,63 @@
|
||||||
import {
|
import { LemmyHttp } from "lemmy-js-client";
|
||||||
Login,
|
import { CreatePost } from "lemmy-js-client/dist/types/CreatePost";
|
||||||
LoginResponse,
|
import { DeletePost } from "lemmy-js-client/dist/types/DeletePost";
|
||||||
CreatePost,
|
import { EditPost } from "lemmy-js-client/dist/types/EditPost";
|
||||||
EditPost,
|
import { EditSite } from "lemmy-js-client/dist/types/EditSite";
|
||||||
CreateComment,
|
import { FeaturePost } from "lemmy-js-client/dist/types/FeaturePost";
|
||||||
DeletePost,
|
import { GetComments } from "lemmy-js-client/dist/types/GetComments";
|
||||||
RemovePost,
|
import { GetCommentsResponse } from "lemmy-js-client/dist/types/GetCommentsResponse";
|
||||||
LockPost,
|
import { GetPost } from "lemmy-js-client/dist/types/GetPost";
|
||||||
PostResponse,
|
import { GetPostResponse } from "lemmy-js-client/dist/types/GetPostResponse";
|
||||||
SearchResponse,
|
import { LockPost } from "lemmy-js-client/dist/types/LockPost";
|
||||||
FollowCommunity,
|
import { Login } from "lemmy-js-client/dist/types/Login";
|
||||||
CommunityResponse,
|
import { Post } from "lemmy-js-client/dist/types/Post";
|
||||||
GetPostResponse,
|
import { PostResponse } from "lemmy-js-client/dist/types/PostResponse";
|
||||||
Register,
|
import { RemovePost } from "lemmy-js-client/dist/types/RemovePost";
|
||||||
Comment,
|
import { ResolveObject } from "lemmy-js-client/dist/types/ResolveObject";
|
||||||
EditComment,
|
import { ResolveObjectResponse } from "lemmy-js-client/dist/types/ResolveObjectResponse";
|
||||||
DeleteComment,
|
import { Search } from "lemmy-js-client/dist/types/Search";
|
||||||
RemoveComment,
|
import { SearchResponse } from "lemmy-js-client/dist/types/SearchResponse";
|
||||||
Search,
|
import { Comment } from "lemmy-js-client/dist/types/Comment";
|
||||||
CommentResponse,
|
import { BanPersonResponse } from "lemmy-js-client/dist/types/BanPersonResponse";
|
||||||
GetCommunity,
|
import { BanPerson } from "lemmy-js-client/dist/types/BanPerson";
|
||||||
CreateCommunity,
|
import { BanFromCommunityResponse } from "lemmy-js-client/dist/types/BanFromCommunityResponse";
|
||||||
DeleteCommunity,
|
import { BanFromCommunity } from "lemmy-js-client/dist/types/BanFromCommunity";
|
||||||
RemoveCommunity,
|
import { CommunityResponse } from "lemmy-js-client/dist/types/CommunityResponse";
|
||||||
GetPersonMentions,
|
import { FollowCommunity } from "lemmy-js-client/dist/types/FollowCommunity";
|
||||||
CreateCommentLike,
|
import { CreatePostLike } from "lemmy-js-client/dist/types/CreatePostLike";
|
||||||
CreatePostLike,
|
import { CommentResponse } from "lemmy-js-client/dist/types/CommentResponse";
|
||||||
EditPrivateMessage,
|
import { CreateComment } from "lemmy-js-client/dist/types/CreateComment";
|
||||||
DeletePrivateMessage,
|
import { EditComment } from "lemmy-js-client/dist/types/EditComment";
|
||||||
GetPrivateMessages,
|
import { DeleteComment } from "lemmy-js-client/dist/types/DeleteComment";
|
||||||
GetSite,
|
import { RemoveComment } from "lemmy-js-client/dist/types/RemoveComment";
|
||||||
GetPost,
|
import { GetPersonMentionsResponse } from "lemmy-js-client/dist/types/GetPersonMentionsResponse";
|
||||||
PrivateMessageResponse,
|
import { GetPersonMentions } from "lemmy-js-client/dist/types/GetPersonMentions";
|
||||||
PrivateMessagesResponse,
|
import { CreateCommentLike } from "lemmy-js-client/dist/types/CreateCommentLike";
|
||||||
GetPersonMentionsResponse,
|
import { CreateCommunity } from "lemmy-js-client/dist/types/CreateCommunity";
|
||||||
SaveUserSettings,
|
import { GetCommunity } from "lemmy-js-client/dist/types/GetCommunity";
|
||||||
SortType,
|
import { DeleteCommunity } from "lemmy-js-client/dist/types/DeleteCommunity";
|
||||||
ListingType,
|
import { RemoveCommunity } from "lemmy-js-client/dist/types/RemoveCommunity";
|
||||||
GetSiteResponse,
|
import { PrivateMessageResponse } from "lemmy-js-client/dist/types/PrivateMessageResponse";
|
||||||
SearchType,
|
import { CreatePrivateMessage } from "lemmy-js-client/dist/types/CreatePrivateMessage";
|
||||||
LemmyHttp,
|
import { EditPrivateMessage } from "lemmy-js-client/dist/types/EditPrivateMessage";
|
||||||
BanPersonResponse,
|
import { DeletePrivateMessage } from "lemmy-js-client/dist/types/DeletePrivateMessage";
|
||||||
BanPerson,
|
import { LoginResponse } from "lemmy-js-client/dist/types/LoginResponse";
|
||||||
BanFromCommunity,
|
import { Register } from "lemmy-js-client/dist/types/Register";
|
||||||
BanFromCommunityResponse,
|
import { SaveUserSettings } from "lemmy-js-client/dist/types/SaveUserSettings";
|
||||||
Post,
|
import { DeleteAccount } from "lemmy-js-client/dist/types/DeleteAccount";
|
||||||
CreatePrivateMessage,
|
import { GetSiteResponse } from "lemmy-js-client/dist/types/GetSiteResponse";
|
||||||
ResolveObjectResponse,
|
import { DeleteAccountResponse } from "lemmy-js-client/dist/types/DeleteAccountResponse";
|
||||||
ResolveObject,
|
import { GetSite } from "lemmy-js-client/dist/types/GetSite";
|
||||||
CreatePostReport,
|
import { PrivateMessagesResponse } from "lemmy-js-client/dist/types/PrivateMessagesResponse";
|
||||||
ListPostReports,
|
import { GetPrivateMessages } from "lemmy-js-client/dist/types/GetPrivateMessages";
|
||||||
PostReportResponse,
|
import { PostReportResponse } from "lemmy-js-client/dist/types/PostReportResponse";
|
||||||
ListPostReportsResponse,
|
import { CreatePostReport } from "lemmy-js-client/dist/types/CreatePostReport";
|
||||||
CreateCommentReport,
|
import { ListPostReportsResponse } from "lemmy-js-client/dist/types/ListPostReportsResponse";
|
||||||
CommentReportResponse,
|
import { ListPostReports } from "lemmy-js-client/dist/types/ListPostReports";
|
||||||
ListCommentReports,
|
import { CommentReportResponse } from "lemmy-js-client/dist/types/CommentReportResponse";
|
||||||
ListCommentReportsResponse,
|
import { CreateCommentReport } from "lemmy-js-client/dist/types/CreateCommentReport";
|
||||||
DeleteAccount,
|
import { ListCommentReportsResponse } from "lemmy-js-client/dist/types/ListCommentReportsResponse";
|
||||||
DeleteAccountResponse,
|
import { ListCommentReports } from "lemmy-js-client/dist/types/ListCommentReports";
|
||||||
EditSite,
|
|
||||||
CommentSortType,
|
|
||||||
GetComments,
|
|
||||||
GetCommentsResponse,
|
|
||||||
FeaturePost,
|
|
||||||
PostFeatureType,
|
|
||||||
RegistrationMode,
|
|
||||||
} from "lemmy-js-client";
|
|
||||||
|
|
||||||
export interface API {
|
export interface API {
|
||||||
client: LemmyHttp;
|
client: LemmyHttp;
|
||||||
|
@ -146,7 +138,7 @@ export async function setupLogins() {
|
||||||
|
|
||||||
// Registration applications are now enabled by default, need to disable them
|
// Registration applications are now enabled by default, need to disable them
|
||||||
let editSiteForm: EditSite = {
|
let editSiteForm: EditSite = {
|
||||||
registration_mode: RegistrationMode.Open,
|
registration_mode: "Open",
|
||||||
rate_limit_message: 999,
|
rate_limit_message: 999,
|
||||||
rate_limit_post: 999,
|
rate_limit_post: 999,
|
||||||
rate_limit_register: 999,
|
rate_limit_register: 999,
|
||||||
|
@ -259,7 +251,7 @@ export async function featurePost(
|
||||||
let form: FeaturePost = {
|
let form: FeaturePost = {
|
||||||
post_id: post.id,
|
post_id: post.id,
|
||||||
featured,
|
featured,
|
||||||
feature_type: PostFeatureType.Community,
|
feature_type: "Community",
|
||||||
auth: api.auth,
|
auth: api.auth,
|
||||||
};
|
};
|
||||||
return api.client.featurePost(form);
|
return api.client.featurePost(form);
|
||||||
|
@ -295,8 +287,8 @@ export async function searchPostLocal(
|
||||||
): Promise<SearchResponse> {
|
): Promise<SearchResponse> {
|
||||||
let form: Search = {
|
let form: Search = {
|
||||||
q: post.name,
|
q: post.name,
|
||||||
type_: SearchType.Posts,
|
type_: "Posts",
|
||||||
sort: SortType.TopAll,
|
sort: "TopAll",
|
||||||
auth: api.auth,
|
auth: api.auth,
|
||||||
};
|
};
|
||||||
return api.client.search(form);
|
return api.client.search(form);
|
||||||
|
@ -319,8 +311,8 @@ export async function getComments(
|
||||||
): Promise<GetCommentsResponse> {
|
): Promise<GetCommentsResponse> {
|
||||||
let form: GetComments = {
|
let form: GetComments = {
|
||||||
post_id: post_id,
|
post_id: post_id,
|
||||||
type_: ListingType.All,
|
type_: "All",
|
||||||
sort: CommentSortType.New,
|
sort: "New",
|
||||||
auth: api.auth,
|
auth: api.auth,
|
||||||
};
|
};
|
||||||
return api.client.getComments(form);
|
return api.client.getComments(form);
|
||||||
|
@ -488,7 +480,7 @@ export async function getMentions(
|
||||||
api: API
|
api: API
|
||||||
): Promise<GetPersonMentionsResponse> {
|
): Promise<GetPersonMentionsResponse> {
|
||||||
let form: GetPersonMentions = {
|
let form: GetPersonMentions = {
|
||||||
sort: CommentSortType.New,
|
sort: "New",
|
||||||
unread_only: false,
|
unread_only: false,
|
||||||
auth: api.auth,
|
auth: api.auth,
|
||||||
};
|
};
|
||||||
|
@ -615,8 +607,8 @@ export async function saveUserSettingsBio(api: API): Promise<LoginResponse> {
|
||||||
let form: SaveUserSettings = {
|
let form: SaveUserSettings = {
|
||||||
show_nsfw: true,
|
show_nsfw: true,
|
||||||
theme: "darkly",
|
theme: "darkly",
|
||||||
default_sort_type: SortType.Active,
|
default_sort_type: "Active",
|
||||||
default_listing_type: ListingType.All,
|
default_listing_type: "All",
|
||||||
interface_language: "en",
|
interface_language: "en",
|
||||||
show_avatars: true,
|
show_avatars: true,
|
||||||
send_notifications_to_email: false,
|
send_notifications_to_email: false,
|
||||||
|
@ -634,8 +626,8 @@ export async function saveUserSettingsFederated(
|
||||||
let bio = "a changed bio";
|
let bio = "a changed bio";
|
||||||
let form: SaveUserSettings = {
|
let form: SaveUserSettings = {
|
||||||
show_nsfw: false,
|
show_nsfw: false,
|
||||||
default_sort_type: SortType.Hot,
|
default_sort_type: "Hot",
|
||||||
default_listing_type: ListingType.All,
|
default_listing_type: "All",
|
||||||
interface_language: "",
|
interface_language: "",
|
||||||
avatar,
|
avatar,
|
||||||
banner,
|
banner,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
jest.setTimeout(120000);
|
jest.setTimeout(120000);
|
||||||
import { PersonView } from "lemmy-js-client";
|
|
||||||
|
|
||||||
|
import { PersonView } from "lemmy-js-client/dist/types/PersonView";
|
||||||
import {
|
import {
|
||||||
alpha,
|
alpha,
|
||||||
beta,
|
beta,
|
||||||
|
|
|
@ -2379,10 +2379,10 @@ kleur@^3.0.3:
|
||||||
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
|
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
|
||||||
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
|
integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==
|
||||||
|
|
||||||
lemmy-js-client@0.17.2-rc.6:
|
lemmy-js-client@0.17.2-rc.11:
|
||||||
version "0.17.2-rc.6"
|
version "0.17.2-rc.11"
|
||||||
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.6.tgz#cd488bc30edf7b65a02b91f1bc295d1b958e9b86"
|
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.11.tgz#fb23d28b5fd4349fd53832010c92755d0402ac6c"
|
||||||
integrity sha512-/EdzpLJpYOq3ypCQA1MyI7sX0DmHUIA1ZUIda2XTCUUP7a5pltF7WHTicFrQ9j6JwCiFMTVkw6S/L8LzfD6cGA==
|
integrity sha512-Dn+ZPF3lw3PAEPv+F7Y5ymnXi1vRa/rjBjyP41QzjITPREU2HSZIQN5R6nQKiUU0DyKpzySvuLGCg6Q+iA68Kw==
|
||||||
dependencies:
|
dependencies:
|
||||||
cross-fetch "^3.1.5"
|
cross-fetch "^3.1.5"
|
||||||
form-data "^4.0.0"
|
form-data "^4.0.0"
|
||||||
|
|
|
@ -16,7 +16,7 @@ doctest = false
|
||||||
[features]
|
[features]
|
||||||
full = ["tracing", "rosetta-i18n", "chrono", "actix-web", "lemmy_utils",
|
full = ["tracing", "rosetta-i18n", "chrono", "actix-web", "lemmy_utils",
|
||||||
"lemmy_db_views/full", "lemmy_db_views_actor/full", "lemmy_db_views_moderator/full",
|
"lemmy_db_views/full", "lemmy_db_views_actor/full", "lemmy_db_views_moderator/full",
|
||||||
"percent-encoding", "encoding", "reqwest-middleware", "webpage"]
|
"percent-encoding", "encoding", "reqwest-middleware", "webpage", "ts-rs"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_db_views = { workspace = true }
|
lemmy_db_views = { workspace = true }
|
||||||
|
@ -25,6 +25,7 @@ lemmy_db_views_actor = { workspace = true }
|
||||||
lemmy_db_schema = { workspace = true, default-features = false }
|
lemmy_db_schema = { workspace = true, default-features = false }
|
||||||
lemmy_utils = { workspace = true, optional = true }
|
lemmy_utils = { workspace = true, optional = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
|
serde_with = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
actix-web = { workspace = true, features = ["cookies"], optional = true }
|
actix-web = { workspace = true, features = ["cookies"], optional = true }
|
||||||
chrono = { workspace = true, optional = true }
|
chrono = { workspace = true, optional = true }
|
||||||
|
@ -45,3 +46,4 @@ futures = { workspace = true }
|
||||||
uuid = { workspace = true }
|
uuid = { workspace = true }
|
||||||
actix-rt = { workspace = true }
|
actix-rt = { workspace = true }
|
||||||
reqwest = { workspace = true }
|
reqwest = { workspace = true }
|
||||||
|
ts-rs = { workspace = true, optional = true }
|
||||||
|
|
|
@ -6,8 +6,14 @@ use lemmy_db_schema::{
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CommentReportView, CommentView};
|
use lemmy_db_views::structs::{CommentReportView, CommentView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreateComment {
|
pub struct CreateComment {
|
||||||
pub content: String,
|
pub content: String,
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
|
@ -17,13 +23,19 @@ pub struct CreateComment {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetComment {
|
pub struct GetComment {
|
||||||
pub id: CommentId,
|
pub id: CommentId,
|
||||||
pub auth: Option<Sensitive<String>>,
|
pub auth: Option<Sensitive<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct EditComment {
|
pub struct EditComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub content: Option<String>,
|
pub content: Option<String>,
|
||||||
|
@ -32,21 +44,30 @@ pub struct EditComment {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DistinguishComment {
|
pub struct DistinguishComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub distinguished: bool,
|
pub distinguished: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeleteComment {
|
pub struct DeleteComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct RemoveComment {
|
pub struct RemoveComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub removed: bool,
|
pub removed: bool,
|
||||||
|
@ -55,27 +76,38 @@ pub struct RemoveComment {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SaveComment {
|
pub struct SaveComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub save: bool,
|
pub save: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentResponse {
|
pub struct CommentResponse {
|
||||||
pub comment_view: CommentView,
|
pub comment_view: CommentView,
|
||||||
pub recipient_ids: Vec<LocalUserId>,
|
pub recipient_ids: Vec<LocalUserId>,
|
||||||
pub form_id: Option<String>, // An optional front end ID, to tell which is coming back
|
/// An optional front end ID, to tell which is coming back
|
||||||
|
pub form_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreateCommentLike {
|
pub struct CreateCommentLike {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub score: i16,
|
pub score: i16,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetComments {
|
pub struct GetComments {
|
||||||
pub type_: Option<ListingType>,
|
pub type_: Option<ListingType>,
|
||||||
pub sort: Option<CommentSortType>,
|
pub sort: Option<CommentSortType>,
|
||||||
|
@ -91,11 +123,15 @@ pub struct GetComments {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetCommentsResponse {
|
pub struct GetCommentsResponse {
|
||||||
pub comments: Vec<CommentView>,
|
pub comments: Vec<CommentView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreateCommentReport {
|
pub struct CreateCommentReport {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub reason: String,
|
pub reason: String,
|
||||||
|
@ -103,20 +139,28 @@ pub struct CreateCommentReport {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReportResponse {
|
pub struct CommentReportResponse {
|
||||||
pub comment_report_view: CommentReportView,
|
pub comment_report_view: CommentReportView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ResolveCommentReport {
|
pub struct ResolveCommentReport {
|
||||||
pub report_id: CommentReportId,
|
pub report_id: CommentReportId,
|
||||||
pub resolved: bool,
|
pub resolved: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListCommentReports {
|
pub struct ListCommentReports {
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
/// Only shows the unresolved reports
|
/// Only shows the unresolved reports
|
||||||
pub unresolved_only: Option<bool>,
|
pub unresolved_only: Option<bool>,
|
||||||
|
@ -126,6 +170,8 @@ pub struct ListCommentReports {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListCommentReportsResponse {
|
pub struct ListCommentReportsResponse {
|
||||||
pub comment_reports: Vec<CommentReportView>,
|
pub comment_reports: Vec<CommentReportView>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,14 @@ use lemmy_db_schema::{
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView, PersonView};
|
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView, PersonView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetCommunity {
|
pub struct GetCommunity {
|
||||||
pub id: Option<CommunityId>,
|
pub id: Option<CommunityId>,
|
||||||
/// Example: star_trek , or star_trek@xyz.tld
|
/// Example: star_trek , or star_trek@xyz.tld
|
||||||
|
@ -16,7 +22,10 @@ pub struct GetCommunity {
|
||||||
pub auth: Option<Sensitive<String>>,
|
pub auth: Option<Sensitive<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetCommunityResponse {
|
pub struct GetCommunityResponse {
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
pub site: Option<Site>,
|
pub site: Option<Site>,
|
||||||
|
@ -28,6 +37,9 @@ pub struct GetCommunityResponse {
|
||||||
pub default_post_language: Option<LanguageId>,
|
pub default_post_language: Option<LanguageId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
pub struct CreateCommunity {
|
pub struct CreateCommunity {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
@ -42,12 +54,17 @@ pub struct CreateCommunity {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityResponse {
|
pub struct CommunityResponse {
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
pub discussion_languages: Vec<LanguageId>,
|
pub discussion_languages: Vec<LanguageId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListCommunities {
|
pub struct ListCommunities {
|
||||||
pub type_: Option<ListingType>,
|
pub type_: Option<ListingType>,
|
||||||
pub sort: Option<SortType>,
|
pub sort: Option<SortType>,
|
||||||
|
@ -57,11 +74,16 @@ pub struct ListCommunities {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListCommunitiesResponse {
|
pub struct ListCommunitiesResponse {
|
||||||
pub communities: Vec<CommunityView>,
|
pub communities: Vec<CommunityView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BanFromCommunity {
|
pub struct BanFromCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
@ -73,12 +95,16 @@ pub struct BanFromCommunity {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BanFromCommunityResponse {
|
pub struct BanFromCommunityResponse {
|
||||||
pub person_view: PersonView,
|
pub person_view: PersonView,
|
||||||
pub banned: bool,
|
pub banned: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AddModToCommunity {
|
pub struct AddModToCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
@ -87,11 +113,16 @@ pub struct AddModToCommunity {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AddModToCommunityResponse {
|
pub struct AddModToCommunityResponse {
|
||||||
pub moderators: Vec<CommunityModeratorView>,
|
pub moderators: Vec<CommunityModeratorView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct EditCommunity {
|
pub struct EditCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
|
@ -104,7 +135,10 @@ pub struct EditCommunity {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct HideCommunity {
|
pub struct HideCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub hidden: bool,
|
pub hidden: bool,
|
||||||
|
@ -112,14 +146,20 @@ pub struct HideCommunity {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeleteCommunity {
|
pub struct DeleteCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct RemoveCommunity {
|
pub struct RemoveCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub removed: bool,
|
pub removed: bool,
|
||||||
|
@ -129,6 +169,8 @@ pub struct RemoveCommunity {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct FollowCommunity {
|
pub struct FollowCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub follow: bool,
|
pub follow: bool,
|
||||||
|
@ -136,19 +178,26 @@ pub struct FollowCommunity {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BlockCommunity {
|
pub struct BlockCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub block: bool,
|
pub block: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BlockCommunityResponse {
|
pub struct BlockCommunityResponse {
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
pub blocked: bool,
|
pub blocked: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct TransferCommunity {
|
pub struct TransferCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
|
|
@ -2,12 +2,17 @@ use crate::sensitive::Sensitive;
|
||||||
use lemmy_db_schema::newtypes::CustomEmojiId;
|
use lemmy_db_schema::newtypes::CustomEmojiId;
|
||||||
use lemmy_db_views::structs::CustomEmojiView;
|
use lemmy_db_views::structs::CustomEmojiView;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreateCustomEmoji {
|
pub struct CreateCustomEmoji {
|
||||||
pub category: String,
|
pub category: String,
|
||||||
pub shortcode: String,
|
pub shortcode: String,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub image_url: Url,
|
pub image_url: Url,
|
||||||
pub alt_text: String,
|
pub alt_text: String,
|
||||||
pub keywords: Vec<String>,
|
pub keywords: Vec<String>,
|
||||||
|
@ -15,9 +20,12 @@ pub struct CreateCustomEmoji {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct EditCustomEmoji {
|
pub struct EditCustomEmoji {
|
||||||
pub id: CustomEmojiId,
|
pub id: CustomEmojiId,
|
||||||
pub category: String,
|
pub category: String,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub image_url: Url,
|
pub image_url: Url,
|
||||||
pub alt_text: String,
|
pub alt_text: String,
|
||||||
pub keywords: Vec<String>,
|
pub keywords: Vec<String>,
|
||||||
|
@ -25,18 +33,24 @@ pub struct EditCustomEmoji {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeleteCustomEmoji {
|
pub struct DeleteCustomEmoji {
|
||||||
pub id: CustomEmojiId,
|
pub id: CustomEmojiId,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeleteCustomEmojiResponse {
|
pub struct DeleteCustomEmojiResponse {
|
||||||
pub id: CustomEmojiId,
|
pub id: CustomEmojiId,
|
||||||
pub success: bool,
|
pub success: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CustomEmojiResponse {
|
pub struct CustomEmojiResponse {
|
||||||
pub custom_emoji: CustomEmojiView,
|
pub custom_emoji: CustomEmojiView,
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,24 @@ use lemmy_db_views_actor::structs::{
|
||||||
PersonView,
|
PersonView,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Login {
|
pub struct Login {
|
||||||
pub username_or_email: Sensitive<String>,
|
pub username_or_email: Sensitive<String>,
|
||||||
pub password: Sensitive<String>,
|
pub password: Sensitive<String>,
|
||||||
pub totp_2fa_token: Option<String>,
|
pub totp_2fa_token: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Register {
|
pub struct Register {
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password: Sensitive<String>,
|
pub password: Sensitive<String>,
|
||||||
|
@ -37,21 +46,33 @@ pub struct Register {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetCaptcha {}
|
pub struct GetCaptcha {}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetCaptchaResponse {
|
pub struct GetCaptchaResponse {
|
||||||
pub ok: Option<CaptchaResponse>, // Will be None if captchas are disabled
|
pub ok: Option<CaptchaResponse>, // Will be None if captchas are disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CaptchaResponse {
|
pub struct CaptchaResponse {
|
||||||
pub png: String, // A Base64 encoded png
|
/// A Base64 encoded png
|
||||||
pub wav: String, // A Base64 encoded wav audio
|
pub png: String,
|
||||||
|
/// A Base64 encoded wav audio
|
||||||
|
pub wav: String,
|
||||||
pub uuid: String,
|
pub uuid: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SaveUserSettings {
|
pub struct SaveUserSettings {
|
||||||
pub show_nsfw: Option<bool>,
|
pub show_nsfw: Option<bool>,
|
||||||
pub show_scores: Option<bool>,
|
pub show_scores: Option<bool>,
|
||||||
|
@ -78,6 +99,8 @@ pub struct SaveUserSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ChangePassword {
|
pub struct ChangePassword {
|
||||||
pub new_password: Sensitive<String>,
|
pub new_password: Sensitive<String>,
|
||||||
pub new_password_verify: Sensitive<String>,
|
pub new_password_verify: Sensitive<String>,
|
||||||
|
@ -85,7 +108,10 @@ pub struct ChangePassword {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LoginResponse {
|
pub struct LoginResponse {
|
||||||
/// This is None in response to `Register` if email verification is enabled, or the server requires registration applications.
|
/// This is None in response to `Register` if email verification is enabled, or the server requires registration applications.
|
||||||
pub jwt: Option<Sensitive<String>>,
|
pub jwt: Option<Sensitive<String>>,
|
||||||
|
@ -93,7 +119,10 @@ pub struct LoginResponse {
|
||||||
pub verify_email_sent: bool,
|
pub verify_email_sent: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPersonDetails {
|
pub struct GetPersonDetails {
|
||||||
pub person_id: Option<PersonId>, // One of these two are required
|
pub person_id: Option<PersonId>, // One of these two are required
|
||||||
/// Example: dessalines , or dessalines@xyz.tld
|
/// Example: dessalines , or dessalines@xyz.tld
|
||||||
|
@ -107,6 +136,8 @@ pub struct GetPersonDetails {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPersonDetailsResponse {
|
pub struct GetPersonDetailsResponse {
|
||||||
pub person_view: PersonView,
|
pub person_view: PersonView,
|
||||||
pub comments: Vec<CommentView>,
|
pub comments: Vec<CommentView>,
|
||||||
|
@ -115,21 +146,29 @@ pub struct GetPersonDetailsResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetRepliesResponse {
|
pub struct GetRepliesResponse {
|
||||||
pub replies: Vec<CommentReplyView>,
|
pub replies: Vec<CommentReplyView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPersonMentionsResponse {
|
pub struct GetPersonMentionsResponse {
|
||||||
pub mentions: Vec<PersonMentionView>,
|
pub mentions: Vec<PersonMentionView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct MarkAllAsRead {
|
pub struct MarkAllAsRead {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AddAdmin {
|
pub struct AddAdmin {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub added: bool,
|
pub added: bool,
|
||||||
|
@ -137,11 +176,16 @@ pub struct AddAdmin {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AddAdminResponse {
|
pub struct AddAdminResponse {
|
||||||
pub admins: Vec<PersonView>,
|
pub admins: Vec<PersonView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BanPerson {
|
pub struct BanPerson {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub ban: bool,
|
pub ban: bool,
|
||||||
|
@ -152,22 +196,30 @@ pub struct BanPerson {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetBannedPersons {
|
pub struct GetBannedPersons {
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BannedPersonsResponse {
|
pub struct BannedPersonsResponse {
|
||||||
pub banned: Vec<PersonView>,
|
pub banned: Vec<PersonView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BanPersonResponse {
|
pub struct BanPersonResponse {
|
||||||
pub person_view: PersonView,
|
pub person_view: PersonView,
|
||||||
pub banned: bool,
|
pub banned: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BlockPerson {
|
pub struct BlockPerson {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub block: bool,
|
pub block: bool,
|
||||||
|
@ -175,12 +227,17 @@ pub struct BlockPerson {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct BlockPersonResponse {
|
pub struct BlockPersonResponse {
|
||||||
pub person_view: PersonView,
|
pub person_view: PersonView,
|
||||||
pub blocked: bool,
|
pub blocked: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetReplies {
|
pub struct GetReplies {
|
||||||
pub sort: Option<CommentSortType>,
|
pub sort: Option<CommentSortType>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
@ -189,7 +246,10 @@ pub struct GetReplies {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPersonMentions {
|
pub struct GetPersonMentions {
|
||||||
pub sort: Option<CommentSortType>,
|
pub sort: Option<CommentSortType>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
@ -199,6 +259,8 @@ pub struct GetPersonMentions {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct MarkPersonMentionAsRead {
|
pub struct MarkPersonMentionAsRead {
|
||||||
pub person_mention_id: PersonMentionId,
|
pub person_mention_id: PersonMentionId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
|
@ -206,11 +268,15 @@ pub struct MarkPersonMentionAsRead {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonMentionResponse {
|
pub struct PersonMentionResponse {
|
||||||
pub person_mention_view: PersonMentionView,
|
pub person_mention_view: PersonMentionView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct MarkCommentReplyAsRead {
|
pub struct MarkCommentReplyAsRead {
|
||||||
pub comment_reply_id: CommentReplyId,
|
pub comment_reply_id: CommentReplyId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
|
@ -218,41 +284,59 @@ pub struct MarkCommentReplyAsRead {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReplyResponse {
|
pub struct CommentReplyResponse {
|
||||||
pub comment_reply_view: CommentReplyView,
|
pub comment_reply_view: CommentReplyView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeleteAccount {
|
pub struct DeleteAccount {
|
||||||
pub password: Sensitive<String>,
|
pub password: Sensitive<String>,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeleteAccountResponse {}
|
pub struct DeleteAccountResponse {}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PasswordReset {
|
pub struct PasswordReset {
|
||||||
pub email: Sensitive<String>,
|
pub email: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PasswordResetResponse {}
|
pub struct PasswordResetResponse {}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PasswordChangeAfterReset {
|
pub struct PasswordChangeAfterReset {
|
||||||
pub token: Sensitive<String>,
|
pub token: Sensitive<String>,
|
||||||
pub password: Sensitive<String>,
|
pub password: Sensitive<String>,
|
||||||
pub password_verify: Sensitive<String>,
|
pub password_verify: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetReportCount {
|
pub struct GetReportCount {
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetReportCountResponse {
|
pub struct GetReportCountResponse {
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub comment_reports: i64,
|
pub comment_reports: i64,
|
||||||
|
@ -261,11 +345,15 @@ pub struct GetReportCountResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetUnreadCount {
|
pub struct GetUnreadCount {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetUnreadCountResponse {
|
pub struct GetUnreadCountResponse {
|
||||||
pub replies: i64,
|
pub replies: i64,
|
||||||
pub mentions: i64,
|
pub mentions: i64,
|
||||||
|
@ -273,9 +361,13 @@ pub struct GetUnreadCountResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Clone, Default, Debug)]
|
#[derive(Serialize, Deserialize, Clone, Default, Debug)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct VerifyEmail {
|
pub struct VerifyEmail {
|
||||||
pub token: String,
|
pub token: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct VerifyEmailResponse {}
|
pub struct VerifyEmailResponse {}
|
||||||
|
|
|
@ -8,12 +8,19 @@ use lemmy_db_schema::{
|
||||||
use lemmy_db_views::structs::{PostReportView, PostView};
|
use lemmy_db_views::structs::{PostReportView, PostView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreatePost {
|
pub struct CreatePost {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub url: Option<Url>,
|
pub url: Option<Url>,
|
||||||
pub body: Option<String>,
|
pub body: Option<String>,
|
||||||
pub honeypot: Option<String>,
|
pub honeypot: Option<String>,
|
||||||
|
@ -23,11 +30,16 @@ pub struct CreatePost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostResponse {
|
pub struct PostResponse {
|
||||||
pub post_view: PostView,
|
pub post_view: PostView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[skip_serializing_none]
|
||||||
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPost {
|
pub struct GetPost {
|
||||||
pub id: Option<PostId>,
|
pub id: Option<PostId>,
|
||||||
pub comment_id: Option<CommentId>,
|
pub comment_id: Option<CommentId>,
|
||||||
|
@ -35,6 +47,8 @@ pub struct GetPost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPostResponse {
|
pub struct GetPostResponse {
|
||||||
pub post_view: PostView,
|
pub post_view: PostView,
|
||||||
pub community_view: CommunityView,
|
pub community_view: CommunityView,
|
||||||
|
@ -43,7 +57,10 @@ pub struct GetPostResponse {
|
||||||
pub online: usize,
|
pub online: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPosts {
|
pub struct GetPosts {
|
||||||
pub type_: Option<ListingType>,
|
pub type_: Option<ListingType>,
|
||||||
pub sort: Option<SortType>,
|
pub sort: Option<SortType>,
|
||||||
|
@ -56,21 +73,29 @@ pub struct GetPosts {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPostsResponse {
|
pub struct GetPostsResponse {
|
||||||
pub posts: Vec<PostView>,
|
pub posts: Vec<PostView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreatePostLike {
|
pub struct CreatePostLike {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub score: i16,
|
pub score: i16,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct EditPost {
|
pub struct EditPost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub url: Option<Url>,
|
pub url: Option<Url>,
|
||||||
pub body: Option<String>,
|
pub body: Option<String>,
|
||||||
pub nsfw: Option<bool>,
|
pub nsfw: Option<bool>,
|
||||||
|
@ -79,13 +104,18 @@ pub struct EditPost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeletePost {
|
pub struct DeletePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct RemovePost {
|
pub struct RemovePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub removed: bool,
|
pub removed: bool,
|
||||||
|
@ -94,6 +124,8 @@ pub struct RemovePost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct MarkPostAsRead {
|
pub struct MarkPostAsRead {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
|
@ -101,6 +133,8 @@ pub struct MarkPostAsRead {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LockPost {
|
pub struct LockPost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub locked: bool,
|
pub locked: bool,
|
||||||
|
@ -108,6 +142,8 @@ pub struct LockPost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct FeaturePost {
|
pub struct FeaturePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub featured: bool,
|
pub featured: bool,
|
||||||
|
@ -116,6 +152,8 @@ pub struct FeaturePost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SavePost {
|
pub struct SavePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub save: bool,
|
pub save: bool,
|
||||||
|
@ -123,6 +161,8 @@ pub struct SavePost {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreatePostReport {
|
pub struct CreatePostReport {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub reason: String,
|
pub reason: String,
|
||||||
|
@ -130,18 +170,25 @@ pub struct CreatePostReport {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostReportResponse {
|
pub struct PostReportResponse {
|
||||||
pub post_report_view: PostReportView,
|
pub post_report_view: PostReportView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ResolvePostReport {
|
pub struct ResolvePostReport {
|
||||||
pub report_id: PostReportId,
|
pub report_id: PostReportId,
|
||||||
pub resolved: bool,
|
pub resolved: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListPostReports {
|
pub struct ListPostReports {
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
|
@ -153,21 +200,31 @@ pub struct ListPostReports {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListPostReportsResponse {
|
pub struct ListPostReportsResponse {
|
||||||
pub post_reports: Vec<PostReportView>,
|
pub post_reports: Vec<PostReportView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetSiteMetadata {
|
pub struct GetSiteMetadata {
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub url: Url,
|
pub url: Url,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetSiteMetadataResponse {
|
pub struct GetSiteMetadataResponse {
|
||||||
pub metadata: SiteMetadata,
|
pub metadata: SiteMetadata,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
|
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SiteMetadata {
|
pub struct SiteMetadata {
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
|
|
|
@ -2,8 +2,13 @@ use crate::sensitive::Sensitive;
|
||||||
use lemmy_db_schema::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
|
use lemmy_db_schema::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
|
||||||
use lemmy_db_views::structs::{PrivateMessageReportView, PrivateMessageView};
|
use lemmy_db_views::structs::{PrivateMessageReportView, PrivateMessageView};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreatePrivateMessage {
|
pub struct CreatePrivateMessage {
|
||||||
pub content: String,
|
pub content: String,
|
||||||
pub recipient_id: PersonId,
|
pub recipient_id: PersonId,
|
||||||
|
@ -11,6 +16,8 @@ pub struct CreatePrivateMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct EditPrivateMessage {
|
pub struct EditPrivateMessage {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub content: String,
|
pub content: String,
|
||||||
|
@ -18,6 +25,8 @@ pub struct EditPrivateMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct DeletePrivateMessage {
|
pub struct DeletePrivateMessage {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub deleted: bool,
|
pub deleted: bool,
|
||||||
|
@ -25,13 +34,18 @@ pub struct DeletePrivateMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct MarkPrivateMessageAsRead {
|
pub struct MarkPrivateMessageAsRead {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub read: bool,
|
pub read: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetPrivateMessages {
|
pub struct GetPrivateMessages {
|
||||||
pub unread_only: Option<bool>,
|
pub unread_only: Option<bool>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
|
@ -40,16 +54,22 @@ pub struct GetPrivateMessages {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessagesResponse {
|
pub struct PrivateMessagesResponse {
|
||||||
pub private_messages: Vec<PrivateMessageView>,
|
pub private_messages: Vec<PrivateMessageView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageResponse {
|
pub struct PrivateMessageResponse {
|
||||||
pub private_message_view: PrivateMessageView,
|
pub private_message_view: PrivateMessageView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreatePrivateMessageReport {
|
pub struct CreatePrivateMessageReport {
|
||||||
pub private_message_id: PrivateMessageId,
|
pub private_message_id: PrivateMessageId,
|
||||||
pub reason: String,
|
pub reason: String,
|
||||||
|
@ -57,18 +77,25 @@ pub struct CreatePrivateMessageReport {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageReportResponse {
|
pub struct PrivateMessageReportResponse {
|
||||||
pub private_message_report_view: PrivateMessageReportView,
|
pub private_message_report_view: PrivateMessageReportView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ResolvePrivateMessageReport {
|
pub struct ResolvePrivateMessageReport {
|
||||||
pub report_id: PrivateMessageReportId,
|
pub report_id: PrivateMessageReportId,
|
||||||
pub resolved: bool,
|
pub resolved: bool,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListPrivateMessageReports {
|
pub struct ListPrivateMessageReports {
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
|
@ -78,6 +105,8 @@ pub struct ListPrivateMessageReports {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListPrivateMessageReportsResponse {
|
pub struct ListPrivateMessageReportsResponse {
|
||||||
pub private_message_reports: Vec<PrivateMessageReportView>,
|
pub private_message_reports: Vec<PrivateMessageReportView>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@ use std::{
|
||||||
ops::{Deref, DerefMut},
|
ops::{Deref, DerefMut},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize, Default)]
|
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize, Default)]
|
||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
pub struct Sensitive<T>(T);
|
pub struct Sensitive<T>(T);
|
||||||
|
@ -97,3 +100,19 @@ impl Borrow<str> for Sensitive<String> {
|
||||||
&self.0
|
&self.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
impl TS for Sensitive<String> {
|
||||||
|
fn name() -> String {
|
||||||
|
"string".to_string()
|
||||||
|
}
|
||||||
|
fn name_with_type_args(_args: Vec<String>) -> String {
|
||||||
|
"string".to_string()
|
||||||
|
}
|
||||||
|
fn dependencies() -> Vec<ts_rs::Dependency> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
fn transparent() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -42,8 +42,14 @@ use lemmy_db_views_moderator::structs::{
|
||||||
ModTransferCommunityView,
|
ModTransferCommunityView,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Search {
|
pub struct Search {
|
||||||
pub q: String,
|
pub q: String,
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
|
@ -58,8 +64,10 @@ pub struct Search {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SearchResponse {
|
pub struct SearchResponse {
|
||||||
pub type_: String,
|
pub type_: SearchType,
|
||||||
pub comments: Vec<CommentView>,
|
pub comments: Vec<CommentView>,
|
||||||
pub posts: Vec<PostView>,
|
pub posts: Vec<PostView>,
|
||||||
pub communities: Vec<CommunityView>,
|
pub communities: Vec<CommunityView>,
|
||||||
|
@ -67,12 +75,18 @@ pub struct SearchResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ResolveObject {
|
pub struct ResolveObject {
|
||||||
pub q: String,
|
pub q: String,
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
|
// TODO Change this to an enum
|
||||||
pub struct ResolveObjectResponse {
|
pub struct ResolveObjectResponse {
|
||||||
pub comment: Option<CommentView>,
|
pub comment: Option<CommentView>,
|
||||||
pub post: Option<PostView>,
|
pub post: Option<PostView>,
|
||||||
|
@ -80,18 +94,23 @@ pub struct ResolveObjectResponse {
|
||||||
pub person: Option<PersonView>,
|
pub person: Option<PersonView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetModlog {
|
pub struct GetModlog {
|
||||||
pub mod_person_id: Option<PersonId>,
|
pub mod_person_id: Option<PersonId>,
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
pub auth: Option<Sensitive<String>>,
|
|
||||||
pub type_: Option<ModlogActionType>,
|
pub type_: Option<ModlogActionType>,
|
||||||
pub other_person_id: Option<PersonId>,
|
pub other_person_id: Option<PersonId>,
|
||||||
|
pub auth: Option<Sensitive<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetModlogResponse {
|
pub struct GetModlogResponse {
|
||||||
pub removed_posts: Vec<ModRemovePostView>,
|
pub removed_posts: Vec<ModRemovePostView>,
|
||||||
pub locked_posts: Vec<ModLockPostView>,
|
pub locked_posts: Vec<ModLockPostView>,
|
||||||
|
@ -110,7 +129,10 @@ pub struct GetModlogResponse {
|
||||||
pub hidden_communities: Vec<ModHideCommunityView>,
|
pub hidden_communities: Vec<ModHideCommunityView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CreateSite {
|
pub struct CreateSite {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub sidebar: Option<String>,
|
pub sidebar: Option<String>,
|
||||||
|
@ -155,7 +177,10 @@ pub struct CreateSite {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct EditSite {
|
pub struct EditSite {
|
||||||
pub name: Option<String>,
|
pub name: Option<String>,
|
||||||
pub sidebar: Option<String>,
|
pub sidebar: Option<String>,
|
||||||
|
@ -201,17 +226,25 @@ pub struct EditSite {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetSite {
|
pub struct GetSite {
|
||||||
pub auth: Option<Sensitive<String>>,
|
pub auth: Option<Sensitive<String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SiteResponse {
|
pub struct SiteResponse {
|
||||||
pub site_view: SiteView,
|
pub site_view: SiteView,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetSiteResponse {
|
pub struct GetSiteResponse {
|
||||||
pub site_view: SiteView,
|
pub site_view: SiteView,
|
||||||
pub admins: Vec<PersonView>,
|
pub admins: Vec<PersonView>,
|
||||||
|
@ -225,14 +258,21 @@ pub struct GetSiteResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetFederatedInstances {}
|
pub struct GetFederatedInstances {}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetFederatedInstancesResponse {
|
pub struct GetFederatedInstancesResponse {
|
||||||
pub federated_instances: Option<FederatedInstances>, // Federation may be disabled
|
pub federated_instances: Option<FederatedInstances>, // Federation may be disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct MyUserInfo {
|
pub struct MyUserInfo {
|
||||||
pub local_user_view: LocalUserView,
|
pub local_user_view: LocalUserView,
|
||||||
pub follows: Vec<CommunityFollowerView>,
|
pub follows: Vec<CommunityFollowerView>,
|
||||||
|
@ -243,83 +283,115 @@ pub struct MyUserInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LeaveAdmin {
|
pub struct LeaveAdmin {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct FederatedInstances {
|
pub struct FederatedInstances {
|
||||||
pub linked: Vec<Instance>,
|
pub linked: Vec<Instance>,
|
||||||
pub allowed: Vec<Instance>,
|
pub allowed: Vec<Instance>,
|
||||||
pub blocked: Vec<Instance>,
|
pub blocked: Vec<Instance>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PurgePerson {
|
pub struct PurgePerson {
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PurgeCommunity {
|
pub struct PurgeCommunity {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PurgePost {
|
pub struct PurgePost {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PurgeComment {
|
pub struct PurgeComment {
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PurgeItemResponse {
|
pub struct PurgeItemResponse {
|
||||||
pub success: bool,
|
pub success: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListRegistrationApplications {
|
pub struct ListRegistrationApplications {
|
||||||
/// Only shows the unread applications (IE those without an admin actor)
|
/// Only shows the unread applications (IE those without an admin actor)
|
||||||
pub unread_only: Option<bool>,
|
pub unread_only: Option<bool>,
|
||||||
pub page: Option<i64>,
|
pub page: Option<i64>,
|
||||||
pub limit: Option<i64>,
|
pub limit: Option<i64>,
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ListRegistrationApplicationsResponse {
|
pub struct ListRegistrationApplicationsResponse {
|
||||||
pub registration_applications: Vec<RegistrationApplicationView>,
|
pub registration_applications: Vec<RegistrationApplicationView>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ApproveRegistrationApplication {
|
pub struct ApproveRegistrationApplication {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub approve: bool,
|
pub approve: bool,
|
||||||
pub deny_reason: Option<String>,
|
pub deny_reason: Option<String>,
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct RegistrationApplicationResponse {
|
pub struct RegistrationApplicationResponse {
|
||||||
pub registration_application: RegistrationApplicationView,
|
pub registration_application: RegistrationApplicationView,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetUnreadRegistrationApplicationCount {
|
pub struct GetUnreadRegistrationApplicationCount {
|
||||||
pub auth: String,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct GetUnreadRegistrationApplicationCountResponse {
|
pub struct GetUnreadRegistrationApplicationCountResponse {
|
||||||
pub registration_applications: i64,
|
pub registration_applications: i64,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,43 +1,61 @@
|
||||||
use crate::sensitive::Sensitive;
|
use crate::sensitive::Sensitive;
|
||||||
use lemmy_db_schema::newtypes::{CommunityId, PostId};
|
use lemmy_db_schema::newtypes::{CommunityId, PostId};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct UserJoin {
|
pub struct UserJoin {
|
||||||
pub auth: Sensitive<String>,
|
pub auth: Sensitive<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct UserJoinResponse {
|
pub struct UserJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityJoin {
|
pub struct CommunityJoin {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityJoinResponse {
|
pub struct CommunityJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModJoin {
|
pub struct ModJoin {
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModJoinResponse {
|
pub struct ModJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostJoin {
|
pub struct PostJoin {
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostJoinResponse {
|
pub struct PostJoinResponse {
|
||||||
pub joined: bool,
|
pub joined: bool,
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ anyhow = { workspace = true }
|
||||||
reqwest = { workspace = true }
|
reqwest = { workspace = true }
|
||||||
once_cell = { workspace = true }
|
once_cell = { workspace = true }
|
||||||
html2md = "0.2.13"
|
html2md = "0.2.13"
|
||||||
serde_with = "1.14.0"
|
serde_with = { workspace = true }
|
||||||
http-signature-normalization-actix = { version = "0.6.1", default-features = false, features = ["server", "sha-2"] }
|
http-signature-normalization-actix = { version = "0.6.1", default-features = false, features = ["server", "sha-2"] }
|
||||||
enum_delegate = "0.2.0"
|
enum_delegate = "0.2.0"
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ impl PerformApub for Search {
|
||||||
|
|
||||||
// Return the jwt
|
// Return the jwt
|
||||||
Ok(SearchResponse {
|
Ok(SearchResponse {
|
||||||
type_: search_type.to_string(),
|
type_: search_type,
|
||||||
comments,
|
comments,
|
||||||
posts,
|
posts,
|
||||||
communities,
|
communities,
|
||||||
|
|
|
@ -16,11 +16,12 @@ doctest = false
|
||||||
[features]
|
[features]
|
||||||
full = ["diesel", "diesel-derive-newtype", "diesel-derive-enum", "diesel_migrations", "bcrypt", "lemmy_utils",
|
full = ["diesel", "diesel-derive-newtype", "diesel-derive-enum", "diesel_migrations", "bcrypt", "lemmy_utils",
|
||||||
"activitypub_federation", "sha2", "regex", "once_cell", "serde_json", "diesel_ltree",
|
"activitypub_federation", "sha2", "regex", "once_cell", "serde_json", "diesel_ltree",
|
||||||
"diesel-async", "deadpool"]
|
"diesel-async", "deadpool", "ts-rs"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = { workspace = true }
|
chrono = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
|
serde_with = { workspace = true }
|
||||||
url = { workspace = true }
|
url = { workspace = true }
|
||||||
strum = { workspace = true }
|
strum = { workspace = true }
|
||||||
strum_macros = { workspace = true }
|
strum_macros = { workspace = true }
|
||||||
|
@ -42,6 +43,7 @@ async-trait = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
deadpool = { version = "0.9.5", features = ["rt_tokio_1"], optional = true }
|
deadpool = { version = "0.9.5", features = ["rt_tokio_1"], optional = true }
|
||||||
|
ts-rs = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serial_test = { workspace = true }
|
serial_test = { workspace = true }
|
||||||
|
|
|
@ -9,11 +9,14 @@ use crate::schema::{
|
||||||
site_aggregates,
|
site_aggregates,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = comment_aggregates))]
|
#[cfg_attr(feature = "full", diesel(table_name = comment_aggregates))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentAggregates {
|
pub struct CommentAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub comment_id: CommentId,
|
pub comment_id: CommentId,
|
||||||
|
@ -25,12 +28,13 @@ pub struct CommentAggregates {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = community_aggregates))]
|
#[cfg_attr(feature = "full", diesel(table_name = community_aggregates))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::community::Community))
|
diesel(belongs_to(crate::source::community::Community))
|
||||||
)]
|
)]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityAggregates {
|
pub struct CommunityAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
|
@ -45,9 +49,10 @@ pub struct CommunityAggregates {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Default)]
|
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = person_aggregates))]
|
#[cfg_attr(feature = "full", diesel(table_name = person_aggregates))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::person::Person)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::person::Person)))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonAggregates {
|
pub struct PersonAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
@ -58,9 +63,10 @@ pub struct PersonAggregates {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = post_aggregates))]
|
#[cfg_attr(feature = "full", diesel(table_name = post_aggregates))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostAggregates {
|
pub struct PostAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub post_id: PostId,
|
pub post_id: PostId,
|
||||||
|
@ -98,9 +104,10 @@ pub struct PersonPostAggregatesForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
#[derive(PartialEq, Eq, Debug, Serialize, Deserialize, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = site_aggregates))]
|
#[cfg_attr(feature = "full", diesel(table_name = site_aggregates))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::site::Site)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::site::Site)))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SiteAggregates {
|
pub struct SiteAggregates {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub site_id: SiteId,
|
pub site_id: SiteId,
|
||||||
|
|
|
@ -35,14 +35,17 @@ pub mod utils;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use strum_macros::{Display, EnumString};
|
use strum_macros::{Display, EnumString};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "full", derive(DbEnum))]
|
#[cfg_attr(feature = "full", derive(DbEnum, TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
ExistingTypePath = "crate::schema::sql_types::SortTypeEnum"
|
ExistingTypePath = "crate::schema::sql_types::SortTypeEnum"
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
|
#[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum SortType {
|
pub enum SortType {
|
||||||
Active,
|
Active,
|
||||||
Hot,
|
Hot,
|
||||||
|
@ -58,6 +61,8 @@ pub enum SortType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum CommentSortType {
|
pub enum CommentSortType {
|
||||||
Hot,
|
Hot,
|
||||||
Top,
|
Top,
|
||||||
|
@ -66,12 +71,13 @@ pub enum CommentSortType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "full", derive(DbEnum))]
|
#[cfg_attr(feature = "full", derive(DbEnum, TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
|
ExistingTypePath = "crate::schema::sql_types::ListingTypeEnum"
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
|
#[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum ListingType {
|
pub enum ListingType {
|
||||||
All,
|
All,
|
||||||
Local,
|
Local,
|
||||||
|
@ -79,12 +85,13 @@ pub enum ListingType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "full", derive(DbEnum))]
|
#[cfg_attr(feature = "full", derive(DbEnum, TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
|
ExistingTypePath = "crate::schema::sql_types::RegistrationModeEnum"
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
|
#[cfg_attr(feature = "full", DbValueStyle = "verbatim")]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum RegistrationMode {
|
pub enum RegistrationMode {
|
||||||
Closed,
|
Closed,
|
||||||
RequireApplication,
|
RequireApplication,
|
||||||
|
@ -92,6 +99,8 @@ pub enum RegistrationMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum SearchType {
|
pub enum SearchType {
|
||||||
All,
|
All,
|
||||||
Comments,
|
Comments,
|
||||||
|
@ -102,6 +111,8 @@ pub enum SearchType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
|
#[derive(EnumString, Display, Debug, PartialEq, Eq, Serialize, Deserialize, Clone, Copy)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum SubscribedType {
|
pub enum SubscribedType {
|
||||||
Subscribed,
|
Subscribed,
|
||||||
NotSubscribed,
|
NotSubscribed,
|
||||||
|
@ -109,6 +120,8 @@ pub enum SubscribedType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum ModlogActionType {
|
pub enum ModlogActionType {
|
||||||
All,
|
All,
|
||||||
ModRemovePost,
|
ModRemovePost,
|
||||||
|
@ -131,6 +144,8 @@ pub enum ModlogActionType {
|
||||||
#[derive(
|
#[derive(
|
||||||
EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
|
EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, Default, PartialEq, Eq,
|
||||||
)]
|
)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub enum PostFeatureType {
|
pub enum PostFeatureType {
|
||||||
#[default]
|
#[default]
|
||||||
Local,
|
Local,
|
||||||
|
|
|
@ -13,10 +13,13 @@ use std::{
|
||||||
fmt::{Display, Formatter},
|
fmt::{Display, Formatter},
|
||||||
ops::Deref,
|
ops::Deref,
|
||||||
};
|
};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostId(pub i32);
|
pub struct PostId(pub i32);
|
||||||
|
|
||||||
impl fmt::Display for PostId {
|
impl fmt::Display for PostId {
|
||||||
|
@ -26,11 +29,13 @@ impl fmt::Display for PostId {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonId(pub i32);
|
pub struct PersonId(pub i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentId(pub i32);
|
pub struct CommentId(pub i32);
|
||||||
|
|
||||||
impl fmt::Display for CommentId {
|
impl fmt::Display for CommentId {
|
||||||
|
@ -40,15 +45,18 @@ impl fmt::Display for CommentId {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityId(pub i32);
|
pub struct CommunityId(pub i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Default, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LocalUserId(pub i32);
|
pub struct LocalUserId(pub i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageId(i32);
|
pub struct PrivateMessageId(i32);
|
||||||
|
|
||||||
impl fmt::Display for PrivateMessageId {
|
impl fmt::Display for PrivateMessageId {
|
||||||
|
@ -58,35 +66,43 @@ impl fmt::Display for PrivateMessageId {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonMentionId(i32);
|
pub struct PersonMentionId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonBlockId(i32);
|
pub struct PersonBlockId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityBlockId(i32);
|
pub struct CommunityBlockId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReportId(i32);
|
pub struct CommentReportId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostReportId(i32);
|
pub struct PostReportId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageReportId(i32);
|
pub struct PrivateMessageReportId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SiteId(i32);
|
pub struct SiteId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LanguageId(pub i32);
|
pub struct LanguageId(pub i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
|
@ -102,21 +118,31 @@ pub struct SiteLanguageId(pub i32);
|
||||||
pub struct CommunityLanguageId(pub i32);
|
pub struct CommunityLanguageId(pub i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReplyId(i32);
|
pub struct CommentReplyId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct InstanceId(i32);
|
pub struct InstanceId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LocalSiteId(i32);
|
pub struct LocalSiteId(i32);
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CustomEmojiId(i32);
|
pub struct CustomEmojiId(i32);
|
||||||
|
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
#[derive(Serialize, Deserialize)]
|
||||||
|
#[serde(remote = "Ltree")]
|
||||||
|
/// Do remote derivation for the Ltree struct
|
||||||
|
pub struct LtreeDef(pub String);
|
||||||
|
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Debug)]
|
||||||
#[cfg_attr(feature = "full", derive(AsExpression, FromSqlRow))]
|
#[cfg_attr(feature = "full", derive(AsExpression, FromSqlRow))]
|
||||||
|
@ -129,12 +155,6 @@ impl DbUrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "full")]
|
|
||||||
#[derive(Serialize, Deserialize)]
|
|
||||||
#[serde(remote = "Ltree")]
|
|
||||||
/// Do remote derivation for the Ltree struct
|
|
||||||
pub struct LtreeDef(pub String);
|
|
||||||
|
|
||||||
impl Display for DbUrl {
|
impl Display for DbUrl {
|
||||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||||
self.clone().0.fmt(f)
|
self.clone().0.fmt(f)
|
||||||
|
@ -198,3 +218,16 @@ impl Deref for DbUrl {
|
||||||
&self.0
|
&self.0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
impl TS for DbUrl {
|
||||||
|
fn name() -> String {
|
||||||
|
"string".to_string()
|
||||||
|
}
|
||||||
|
fn dependencies() -> Vec<ts_rs::Dependency> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
fn transparent() -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -6,10 +6,15 @@ use crate::schema::{comment, comment_like, comment_saved};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use diesel_ltree::Ltree;
|
use diesel_ltree::Ltree;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = comment))]
|
#[cfg_attr(feature = "full", diesel(table_name = comment))]
|
||||||
pub struct Comment {
|
pub struct Comment {
|
||||||
|
@ -24,7 +29,8 @@ pub struct Comment {
|
||||||
pub ap_id: DbUrl,
|
pub ap_id: DbUrl,
|
||||||
pub local: bool,
|
pub local: bool,
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
#[serde(with = "LtreeDef")]
|
#[cfg_attr(feature = "full", serde(with = "LtreeDef"))]
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub path: Ltree,
|
pub path: Ltree,
|
||||||
pub distinguished: bool,
|
pub distinguished: bool,
|
||||||
pub language_id: LanguageId,
|
pub language_id: LanguageId,
|
||||||
|
|
|
@ -2,11 +2,14 @@ use crate::newtypes::{CommentId, CommentReplyId, PersonId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::comment_reply;
|
use crate::schema::comment_reply;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = comment_reply))]
|
#[cfg_attr(feature = "full", diesel(table_name = comment_reply))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
/// This table keeps a list of replies to comments and posts.
|
/// This table keeps a list of replies to comments and posts.
|
||||||
pub struct CommentReply {
|
pub struct CommentReply {
|
||||||
pub id: CommentReplyId,
|
pub id: CommentReplyId,
|
||||||
|
|
|
@ -2,11 +2,16 @@ use crate::newtypes::{CommentId, CommentReportId, PersonId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::comment_report;
|
use crate::schema::comment_report;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = comment_report))]
|
#[cfg_attr(feature = "full", diesel(table_name = comment_report))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReport {
|
pub struct CommentReport {
|
||||||
pub id: CommentReportId,
|
pub id: CommentReportId,
|
||||||
pub creator_id: PersonId,
|
pub creator_id: PersonId,
|
||||||
|
|
|
@ -2,11 +2,16 @@ use crate::newtypes::{CommunityId, DbUrl, InstanceId, PersonId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::{community, community_follower, community_moderator, community_person_ban};
|
use crate::schema::{community, community_follower, community_moderator, community_person_ban};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = community))]
|
#[cfg_attr(feature = "full", diesel(table_name = community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Community {
|
pub struct Community {
|
||||||
pub id: CommunityId,
|
pub id: CommunityId,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
@ -2,15 +2,20 @@ use crate::newtypes::{CustomEmojiId, DbUrl, LocalSiteId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::custom_emoji;
|
use crate::schema::custom_emoji;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji))]
|
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::local_site::LocalSite))
|
diesel(belongs_to(crate::source::local_site::LocalSite))
|
||||||
)]
|
)]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CustomEmoji {
|
pub struct CustomEmoji {
|
||||||
pub id: CustomEmojiId,
|
pub id: CustomEmojiId,
|
||||||
pub local_site_id: LocalSiteId,
|
pub local_site_id: LocalSiteId,
|
||||||
|
|
|
@ -2,15 +2,18 @@ use crate::newtypes::CustomEmojiId;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::custom_emoji_keyword;
|
use crate::schema::custom_emoji_keyword;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
|
#[cfg_attr(feature = "full", diesel(table_name = custom_emoji_keyword))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::custom_emoji::CustomEmoji))
|
diesel(belongs_to(crate::source::custom_emoji::CustomEmoji))
|
||||||
)]
|
)]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CustomEmojiKeyword {
|
pub struct CustomEmojiKeyword {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub custom_emoji_id: CustomEmojiId,
|
pub custom_emoji_id: CustomEmojiId,
|
||||||
|
|
|
@ -2,12 +2,17 @@ use crate::newtypes::InstanceId;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::instance;
|
use crate::schema::instance;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = instance))]
|
#[cfg_attr(feature = "full", diesel(table_name = instance))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Instance {
|
pub struct Instance {
|
||||||
pub id: InstanceId,
|
pub id: InstanceId,
|
||||||
pub domain: String,
|
pub domain: String,
|
||||||
|
|
|
@ -2,10 +2,13 @@ use crate::newtypes::LanguageId;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::language;
|
use crate::schema::language;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = language))]
|
#[cfg_attr(feature = "full", diesel(table_name = language))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Language {
|
pub struct Language {
|
||||||
pub id: LanguageId,
|
pub id: LanguageId,
|
||||||
pub code: String,
|
pub code: String,
|
||||||
|
|
|
@ -6,12 +6,17 @@ use crate::{
|
||||||
RegistrationMode,
|
RegistrationMode,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = local_site))]
|
#[cfg_attr(feature = "full", diesel(table_name = local_site))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::site::Site)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::site::Site)))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LocalSite {
|
pub struct LocalSite {
|
||||||
pub id: LocalSiteId,
|
pub id: LocalSiteId,
|
||||||
pub site_id: SiteId,
|
pub site_id: SiteId,
|
||||||
|
|
|
@ -2,15 +2,20 @@ use crate::newtypes::LocalSiteId;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::local_site_rate_limit;
|
use crate::schema::local_site_rate_limit;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = local_site_rate_limit))]
|
#[cfg_attr(feature = "full", diesel(table_name = local_site_rate_limit))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::local_site::LocalSite))
|
diesel(belongs_to(crate::source::local_site::LocalSite))
|
||||||
)]
|
)]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LocalSiteRateLimit {
|
pub struct LocalSiteRateLimit {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub local_site_id: LocalSiteId,
|
pub local_site_id: LocalSiteId,
|
||||||
|
|
|
@ -6,11 +6,16 @@ use crate::{
|
||||||
SortType,
|
SortType,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = local_user))]
|
#[cfg_attr(feature = "full", diesel(table_name = local_user))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LocalUser {
|
pub struct LocalUser {
|
||||||
pub id: LocalUserId,
|
pub id: LocalUserId,
|
||||||
pub person_id: PersonId,
|
pub person_id: PersonId,
|
||||||
|
|
|
@ -18,10 +18,15 @@ use crate::schema::{
|
||||||
mod_transfer_community,
|
mod_transfer_community,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_post))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModRemovePost {
|
pub struct ModRemovePost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -41,8 +46,9 @@ pub struct ModRemovePostForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_lock_post))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModLockPost {
|
pub struct ModLockPost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -60,8 +66,9 @@ pub struct ModLockPostForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_feature_post))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_feature_post))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModFeaturePost {
|
pub struct ModFeaturePost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -80,9 +87,11 @@ pub struct ModFeaturePostForm {
|
||||||
pub is_featured_community: bool,
|
pub is_featured_community: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_comment))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModRemoveComment {
|
pub struct ModRemoveComment {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -101,9 +110,11 @@ pub struct ModRemoveCommentForm {
|
||||||
pub removed: Option<bool>,
|
pub removed: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_remove_community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModRemoveCommunity {
|
pub struct ModRemoveCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -124,9 +135,11 @@ pub struct ModRemoveCommunityForm {
|
||||||
pub expires: Option<chrono::NaiveDateTime>,
|
pub expires: Option<chrono::NaiveDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_ban_from_community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModBanFromCommunity {
|
pub struct ModBanFromCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -149,9 +162,11 @@ pub struct ModBanFromCommunityForm {
|
||||||
pub expires: Option<chrono::NaiveDateTime>,
|
pub expires: Option<chrono::NaiveDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_ban))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModBan {
|
pub struct ModBan {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -170,9 +185,12 @@ pub struct ModHideCommunityForm {
|
||||||
pub hidden: Option<bool>,
|
pub hidden: Option<bool>,
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_hide_community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModHideCommunity {
|
pub struct ModHideCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub community_id: CommunityId,
|
pub community_id: CommunityId,
|
||||||
|
@ -193,8 +211,9 @@ pub struct ModBanForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_add_community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModAddCommunity {
|
pub struct ModAddCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -214,8 +233,9 @@ pub struct ModAddCommunityForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_transfer_community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModTransferCommunity {
|
pub struct ModTransferCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -233,8 +253,9 @@ pub struct ModTransferCommunityForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = mod_add))]
|
#[cfg_attr(feature = "full", diesel(table_name = mod_add))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModAdd {
|
pub struct ModAdd {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub mod_person_id: PersonId,
|
pub mod_person_id: PersonId,
|
||||||
|
@ -251,9 +272,11 @@ pub struct ModAddForm {
|
||||||
pub removed: Option<bool>,
|
pub removed: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_person))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgePerson {
|
pub struct AdminPurgePerson {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub admin_person_id: PersonId,
|
pub admin_person_id: PersonId,
|
||||||
|
@ -268,9 +291,11 @@ pub struct AdminPurgePersonForm {
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_community))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgeCommunity {
|
pub struct AdminPurgeCommunity {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub admin_person_id: PersonId,
|
pub admin_person_id: PersonId,
|
||||||
|
@ -285,9 +310,11 @@ pub struct AdminPurgeCommunityForm {
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_post))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgePost {
|
pub struct AdminPurgePost {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub admin_person_id: PersonId,
|
pub admin_person_id: PersonId,
|
||||||
|
@ -304,9 +331,11 @@ pub struct AdminPurgePostForm {
|
||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
|
#[cfg_attr(feature = "full", diesel(table_name = admin_purge_comment))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgeComment {
|
pub struct AdminPurgeComment {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub admin_person_id: PersonId,
|
pub admin_person_id: PersonId,
|
||||||
|
|
|
@ -2,11 +2,16 @@ use crate::newtypes::{DbUrl, InstanceId, PersonId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::{person, person_follower};
|
use crate::schema::{person, person_follower};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = person))]
|
#[cfg_attr(feature = "full", diesel(table_name = person))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Person {
|
pub struct Person {
|
||||||
pub id: PersonId,
|
pub id: PersonId,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
@ -2,11 +2,14 @@ use crate::newtypes::{CommentId, PersonId, PersonMentionId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::person_mention;
|
use crate::schema::person_mention;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = person_mention))]
|
#[cfg_attr(feature = "full", diesel(table_name = person_mention))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonMention {
|
pub struct PersonMention {
|
||||||
pub id: PersonMentionId,
|
pub id: PersonMentionId,
|
||||||
pub recipient_id: PersonId,
|
pub recipient_id: PersonId,
|
||||||
|
|
|
@ -2,14 +2,20 @@ use crate::newtypes::{CommunityId, DbUrl, LanguageId, PersonId, PostId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::{post, post_like, post_read, post_saved};
|
use crate::schema::{post, post_like, post_read, post_saved};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = post))]
|
#[cfg_attr(feature = "full", diesel(table_name = post))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Post {
|
pub struct Post {
|
||||||
pub id: PostId,
|
pub id: PostId,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub url: Option<DbUrl>,
|
pub url: Option<DbUrl>,
|
||||||
pub body: Option<String>,
|
pub body: Option<String>,
|
||||||
pub creator_id: PersonId,
|
pub creator_id: PersonId,
|
||||||
|
@ -22,9 +28,12 @@ pub struct Post {
|
||||||
pub nsfw: bool,
|
pub nsfw: bool,
|
||||||
pub embed_title: Option<String>,
|
pub embed_title: Option<String>,
|
||||||
pub embed_description: Option<String>,
|
pub embed_description: Option<String>,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub thumbnail_url: Option<DbUrl>,
|
pub thumbnail_url: Option<DbUrl>,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub ap_id: DbUrl,
|
pub ap_id: DbUrl,
|
||||||
pub local: bool,
|
pub local: bool,
|
||||||
|
#[cfg_attr(feature = "full", ts(type = "string"))]
|
||||||
pub embed_video_url: Option<DbUrl>,
|
pub embed_video_url: Option<DbUrl>,
|
||||||
pub language_id: LanguageId,
|
pub language_id: LanguageId,
|
||||||
pub featured_community: bool,
|
pub featured_community: bool,
|
||||||
|
|
|
@ -2,11 +2,16 @@ use crate::newtypes::{DbUrl, PersonId, PostId, PostReportId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::post_report;
|
use crate::schema::post_report;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations))]
|
#[cfg_attr(feature = "full", derive(Identifiable, Queryable, Associations, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))] // Is this the right assoc?
|
#[cfg_attr(feature = "full", diesel(belongs_to(crate::source::post::Post)))] // Is this the right assoc?
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = post_report))]
|
#[cfg_attr(feature = "full", diesel(table_name = post_report))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostReport {
|
pub struct PostReport {
|
||||||
pub id: PostReportId,
|
pub id: PostReportId,
|
||||||
pub creator_id: PersonId,
|
pub creator_id: PersonId,
|
||||||
|
|
|
@ -2,15 +2,20 @@ use crate::newtypes::{DbUrl, PersonId, PrivateMessageId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::private_message;
|
use crate::schema::private_message;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::person::Person, foreign_key = creator_id)
|
diesel(belongs_to(crate::source::person::Person, foreign_key = creator_id)
|
||||||
))] // Is this the right assoc?
|
))] // Is this the right assoc?
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = private_message))]
|
#[cfg_attr(feature = "full", diesel(table_name = private_message))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessage {
|
pub struct PrivateMessage {
|
||||||
pub id: PrivateMessageId,
|
pub id: PrivateMessageId,
|
||||||
pub creator_id: PersonId,
|
pub creator_id: PersonId,
|
||||||
|
|
|
@ -2,14 +2,19 @@ use crate::newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::private_message_report;
|
use crate::schema::private_message_report;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::private_message::PrivateMessage))
|
diesel(belongs_to(crate::source::private_message::PrivateMessage))
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = private_message_report))]
|
#[cfg_attr(feature = "full", diesel(table_name = private_message_report))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageReport {
|
pub struct PrivateMessageReport {
|
||||||
pub id: PrivateMessageReportId,
|
pub id: PrivateMessageReportId,
|
||||||
pub creator_id: PersonId,
|
pub creator_id: PersonId,
|
||||||
|
|
|
@ -2,10 +2,15 @@ use crate::newtypes::{LocalUserId, PersonId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::registration_application;
|
use crate::schema::registration_application;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
|
#[cfg_attr(feature = "full", diesel(table_name = registration_application))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct RegistrationApplication {
|
pub struct RegistrationApplication {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub local_user_id: LocalUserId,
|
pub local_user_id: LocalUserId,
|
||||||
|
|
|
@ -2,11 +2,16 @@ use crate::newtypes::{DbUrl, InstanceId, SiteId};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::site;
|
use crate::schema::site;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
use typed_builder::TypedBuilder;
|
use typed_builder::TypedBuilder;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = site))]
|
#[cfg_attr(feature = "full", diesel(table_name = site))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Site {
|
pub struct Site {
|
||||||
pub id: SiteId,
|
pub id: SiteId,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
|
@ -2,14 +2,19 @@ use crate::newtypes::LocalSiteId;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use crate::schema::tagline;
|
use crate::schema::tagline;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
#[derive(PartialEq, Eq, Debug, Clone, Serialize, Deserialize)]
|
||||||
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
|
#[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable, TS))]
|
||||||
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
|
#[cfg_attr(feature = "full", diesel(table_name = tagline))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "full",
|
feature = "full",
|
||||||
diesel(belongs_to(crate::source::local_site::LocalSite))
|
diesel(belongs_to(crate::source::local_site::LocalSite))
|
||||||
)]
|
)]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct Tagline {
|
pub struct Tagline {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
pub local_site_id: LocalSiteId,
|
pub local_site_id: LocalSiteId,
|
||||||
|
|
|
@ -12,7 +12,7 @@ repository.workspace = true
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "diesel_ltree", "tracing"]
|
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "diesel_ltree", "tracing", "ts-rs"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_db_schema = { workspace = true }
|
lemmy_db_schema = { workspace = true }
|
||||||
|
@ -20,8 +20,10 @@ diesel = { workspace = true, optional = true }
|
||||||
diesel-async = { workspace = true, optional = true}
|
diesel-async = { workspace = true, optional = true}
|
||||||
diesel_ltree = { workspace = true, optional = true}
|
diesel_ltree = { workspace = true, optional = true}
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
|
serde_with = { workspace = true }
|
||||||
tracing = { workspace = true, optional = true }
|
tracing = { workspace = true, optional = true }
|
||||||
typed-builder = { workspace = true }
|
typed-builder = { workspace = true }
|
||||||
|
ts-rs = { workspace = true, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serial_test = { workspace = true }
|
serial_test = { workspace = true }
|
||||||
|
|
|
@ -20,8 +20,14 @@ use lemmy_db_schema::{
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReportView {
|
pub struct CommentReportView {
|
||||||
pub comment_report: CommentReport,
|
pub comment_report: CommentReport,
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
|
@ -35,7 +41,10 @@ pub struct CommentReportView {
|
||||||
pub resolver: Option<Person>,
|
pub resolver: Option<Person>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentView {
|
pub struct CommentView {
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
pub creator: Person,
|
pub creator: Person,
|
||||||
|
@ -50,13 +59,18 @@ pub struct CommentView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct LocalUserView {
|
pub struct LocalUserView {
|
||||||
pub local_user: LocalUser,
|
pub local_user: LocalUser,
|
||||||
pub person: Person,
|
pub person: Person,
|
||||||
pub counts: PersonAggregates,
|
pub counts: PersonAggregates,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostReportView {
|
pub struct PostReportView {
|
||||||
pub post_report: PostReport,
|
pub post_report: PostReport,
|
||||||
pub post: Post,
|
pub post: Post,
|
||||||
|
@ -69,7 +83,10 @@ pub struct PostReportView {
|
||||||
pub resolver: Option<Person>,
|
pub resolver: Option<Person>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PostView {
|
pub struct PostView {
|
||||||
pub post: Post,
|
pub post: Post,
|
||||||
pub creator: Person,
|
pub creator: Person,
|
||||||
|
@ -85,13 +102,18 @@ pub struct PostView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageView {
|
pub struct PrivateMessageView {
|
||||||
pub private_message: PrivateMessage,
|
pub private_message: PrivateMessage,
|
||||||
pub creator: Person,
|
pub creator: Person,
|
||||||
pub recipient: Person,
|
pub recipient: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PrivateMessageReportView {
|
pub struct PrivateMessageReportView {
|
||||||
pub private_message_report: PrivateMessageReport,
|
pub private_message_report: PrivateMessageReport,
|
||||||
pub private_message: PrivateMessage,
|
pub private_message: PrivateMessage,
|
||||||
|
@ -100,7 +122,10 @@ pub struct PrivateMessageReportView {
|
||||||
pub resolver: Option<Person>,
|
pub resolver: Option<Person>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct RegistrationApplicationView {
|
pub struct RegistrationApplicationView {
|
||||||
pub registration_application: RegistrationApplication,
|
pub registration_application: RegistrationApplication,
|
||||||
pub creator_local_user: LocalUser,
|
pub creator_local_user: LocalUser,
|
||||||
|
@ -109,13 +134,18 @@ pub struct RegistrationApplicationView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct SiteView {
|
pub struct SiteView {
|
||||||
pub site: Site,
|
pub site: Site,
|
||||||
pub local_site: LocalSite,
|
pub local_site: LocalSite,
|
||||||
pub local_site_rate_limit: LocalSiteRateLimit,
|
pub local_site_rate_limit: LocalSiteRateLimit,
|
||||||
pub counts: SiteAggregates,
|
pub counts: SiteAggregates,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CustomEmojiView {
|
pub struct CustomEmojiView {
|
||||||
pub custom_emoji: CustomEmoji,
|
pub custom_emoji: CustomEmoji,
|
||||||
pub keywords: Vec<CustomEmojiKeyword>,
|
pub keywords: Vec<CustomEmojiKeyword>,
|
||||||
|
|
|
@ -12,11 +12,13 @@ repository.workspace = true
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async"]
|
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_db_schema = { workspace = true }
|
lemmy_db_schema = { workspace = true }
|
||||||
diesel = { workspace = true, features = ["postgres","chrono","serde_json"], optional = true }
|
diesel = { workspace = true, features = ["postgres","chrono","serde_json"], optional = true }
|
||||||
diesel-async = { workspace = true, features = ["postgres", "deadpool"], optional = true }
|
diesel-async = { workspace = true, features = ["postgres", "deadpool"], optional = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
|
serde_with = { workspace = true }
|
||||||
typed-builder = { workspace = true }
|
typed-builder = { workspace = true }
|
||||||
|
ts-rs = { workspace = true, optional = true }
|
||||||
|
|
|
@ -11,20 +11,29 @@ use lemmy_db_schema::{
|
||||||
SubscribedType,
|
SubscribedType,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityBlockView {
|
pub struct CommunityBlockView {
|
||||||
pub person: Person,
|
pub person: Person,
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityFollowerView {
|
pub struct CommunityFollowerView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
pub follower: Person,
|
pub follower: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityModeratorView {
|
pub struct CommunityModeratorView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
pub moderator: Person,
|
pub moderator: Person,
|
||||||
|
@ -37,6 +46,8 @@ pub struct CommunityPersonBanView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommunityView {
|
pub struct CommunityView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
pub subscribed: SubscribedType,
|
pub subscribed: SubscribedType,
|
||||||
|
@ -45,12 +56,17 @@ pub struct CommunityView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonBlockView {
|
pub struct PersonBlockView {
|
||||||
pub person: Person,
|
pub person: Person,
|
||||||
pub target: Person,
|
pub target: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonMentionView {
|
pub struct PersonMentionView {
|
||||||
pub person_mention: PersonMention,
|
pub person_mention: PersonMention,
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
|
@ -66,7 +82,10 @@ pub struct PersonMentionView {
|
||||||
pub my_vote: Option<i16>, // Left join to CommentLike
|
pub my_vote: Option<i16>, // Left join to CommentLike
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct CommentReplyView {
|
pub struct CommentReplyView {
|
||||||
pub comment_reply: CommentReply,
|
pub comment_reply: CommentReply,
|
||||||
pub comment: Comment,
|
pub comment: Comment,
|
||||||
|
@ -83,6 +102,8 @@ pub struct CommentReplyView {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct PersonView {
|
pub struct PersonView {
|
||||||
pub person: Person,
|
pub person: Person,
|
||||||
pub counts: PersonAggregates,
|
pub counts: PersonAggregates,
|
||||||
|
|
|
@ -12,10 +12,12 @@ repository.workspace = true
|
||||||
doctest = false
|
doctest = false
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
full = ["lemmy_db_schema/full", "diesel", "diesel-async"]
|
full = ["lemmy_db_schema/full", "diesel", "diesel-async", "ts-rs"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_db_schema = { workspace = true }
|
lemmy_db_schema = { workspace = true }
|
||||||
diesel = { workspace = true, features = ["postgres","chrono","serde_json"], optional = true }
|
diesel = { workspace = true, features = ["postgres","chrono","serde_json"], optional = true }
|
||||||
diesel-async = { workspace = true, features = ["postgres", "deadpool"], optional = true }
|
diesel-async = { workspace = true, features = ["postgres", "deadpool"], optional = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
|
serde_with = { workspace = true }
|
||||||
|
ts-rs = { workspace = true, optional = true }
|
||||||
|
|
|
@ -25,8 +25,14 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use ts_rs::TS;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModAddCommunityView {
|
pub struct ModAddCommunityView {
|
||||||
pub mod_add_community: ModAddCommunity,
|
pub mod_add_community: ModAddCommunity,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -34,14 +40,20 @@ pub struct ModAddCommunityView {
|
||||||
pub modded_person: Person,
|
pub modded_person: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModAddView {
|
pub struct ModAddView {
|
||||||
pub mod_add: ModAdd,
|
pub mod_add: ModAdd,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
pub modded_person: Person,
|
pub modded_person: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModBanFromCommunityView {
|
pub struct ModBanFromCommunityView {
|
||||||
pub mod_ban_from_community: ModBanFromCommunity,
|
pub mod_ban_from_community: ModBanFromCommunity,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -49,21 +61,30 @@ pub struct ModBanFromCommunityView {
|
||||||
pub banned_person: Person,
|
pub banned_person: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModBanView {
|
pub struct ModBanView {
|
||||||
pub mod_ban: ModBan,
|
pub mod_ban: ModBan,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
pub banned_person: Person,
|
pub banned_person: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModHideCommunityView {
|
pub struct ModHideCommunityView {
|
||||||
pub mod_hide_community: ModHideCommunity,
|
pub mod_hide_community: ModHideCommunity,
|
||||||
pub admin: Option<Person>,
|
pub admin: Option<Person>,
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModLockPostView {
|
pub struct ModLockPostView {
|
||||||
pub mod_lock_post: ModLockPost,
|
pub mod_lock_post: ModLockPost,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -71,7 +92,10 @@ pub struct ModLockPostView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModRemoveCommentView {
|
pub struct ModRemoveCommentView {
|
||||||
pub mod_remove_comment: ModRemoveComment,
|
pub mod_remove_comment: ModRemoveComment,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -81,14 +105,20 @@ pub struct ModRemoveCommentView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModRemoveCommunityView {
|
pub struct ModRemoveCommunityView {
|
||||||
pub mod_remove_community: ModRemoveCommunity,
|
pub mod_remove_community: ModRemoveCommunity,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModRemovePostView {
|
pub struct ModRemovePostView {
|
||||||
pub mod_remove_post: ModRemovePost,
|
pub mod_remove_post: ModRemovePost,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -96,7 +126,10 @@ pub struct ModRemovePostView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModFeaturePostView {
|
pub struct ModFeaturePostView {
|
||||||
pub mod_feature_post: ModFeaturePost,
|
pub mod_feature_post: ModFeaturePost,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -104,7 +137,10 @@ pub struct ModFeaturePostView {
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModTransferCommunityView {
|
pub struct ModTransferCommunityView {
|
||||||
pub mod_transfer_community: ModTransferCommunity,
|
pub mod_transfer_community: ModTransferCommunity,
|
||||||
pub moderator: Option<Person>,
|
pub moderator: Option<Person>,
|
||||||
|
@ -112,33 +148,48 @@ pub struct ModTransferCommunityView {
|
||||||
pub modded_person: Person,
|
pub modded_person: Person,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgeCommentView {
|
pub struct AdminPurgeCommentView {
|
||||||
pub admin_purge_comment: AdminPurgeComment,
|
pub admin_purge_comment: AdminPurgeComment,
|
||||||
pub admin: Option<Person>,
|
pub admin: Option<Person>,
|
||||||
pub post: Post,
|
pub post: Post,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgeCommunityView {
|
pub struct AdminPurgeCommunityView {
|
||||||
pub admin_purge_community: AdminPurgeCommunity,
|
pub admin_purge_community: AdminPurgeCommunity,
|
||||||
pub admin: Option<Person>,
|
pub admin: Option<Person>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgePersonView {
|
pub struct AdminPurgePersonView {
|
||||||
pub admin_purge_person: AdminPurgePerson,
|
pub admin_purge_person: AdminPurgePerson,
|
||||||
pub admin: Option<Person>,
|
pub admin: Option<Person>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct AdminPurgePostView {
|
pub struct AdminPurgePostView {
|
||||||
pub admin_purge_post: AdminPurgePost,
|
pub admin_purge_post: AdminPurgePost,
|
||||||
pub admin: Option<Person>,
|
pub admin: Option<Person>,
|
||||||
pub community: Community,
|
pub community: Community,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Copy)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
pub struct ModlogListParams {
|
pub struct ModlogListParams {
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
pub mod_person_id: Option<PersonId>,
|
pub mod_person_id: Option<PersonId>,
|
||||||
|
|
Loading…
Reference in a new issue