mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-02 15:21:40 +00:00
Search combined (#5271)
* Renaming person_mention to person_comment_mention. * Finishing up post body mentions. * Combined tables try 2 * Finishing up combined report table. * Fix ts optionals. * Adding tests, triggers, and history updates for report_combined. * Adding profile. * Add cursor pagination to report_combined view (#5244) * add pagination cursor * store timestamp instead of id in cursor (partial) * Revert "store timestamp instead of id in cursor (partial)" This reverts commit89359dde4b
. * use paginated query builder * Fixing migration and paged API. * Using dullbananas trigger procedure * Removing pointless list routes, reorganizing tests. * Fixing column XOR check. * Forgot to remove list report actions. * Cleanup. * Use internal tagging. * Fixing api tests. * Adding a few indexes. * Fixing migration name. * Fixing unique constraints. * Addressing PR comments. * Start working on profile combined * Adding views and replaceable schema. * A few changes to profile view. - Separating the profile fetch from its combined content fetch. - Starting to separate saved_only into its own combined view. * Finishing up combined person_saved and person_content. * Fixing api tests. * Moving to api-v4 routes. * Fixing imports. * Update crates/db_views/src/report_combined_view.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Update crates/db_views/src/report_combined_view.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Update crates/db_views/src/report_combined_view.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Update migrations/2024-12-02-181601_add_report_combined_table/up.sql Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Update migrations/2024-12-02-181601_add_report_combined_table/up.sql Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Fixing import and fmt. * Fixing null types in postgres. * Comment out err. * Fixing TS issues. * Adding types, fixing allow and blocklist crud. * Starting to work on combined views. * Using dullbananas trigger procedure * Adding the full combined view queries. * Adding tests. * taplo fmt. * Upgrading package.json deps. * Updating pnpm * Most of the bulk work done, need to add tests yet. * Finishing up inbox. * Using assert_length * Fixing sql_format. * Running fmt. * Fixing cargo shear. * Fixing clippy. * Addressing PR comments. * Starting to work on search combined. * Fix * Removing serialization * Removing serialization * Moving db_views_actor and _moderator into db_views. - This is necessary because the combined views use both, and that separation was arbitrary to begin with. db_schema has no such crate separation. * Adding search combined view, need to write tests yet. * Filters done, working on tests. * Adding tests for person, post, and community. * Finishing up tests. * Fixing duped trigger. * Remove saved_only test. * Remove pointless post_tags types. * Remove pointless index. * Changing published to saved for person_saved_combined. * Removing comment. * Renaming modlog when_ columns to published. - Fixes #5312 * Adding strum and simplifying imports. * Avoiding clone in map_to_enum * Changing modded_person to other_person. * Update crates/db_views_moderator/src/modlog_combined_view.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Update crates/db_views_moderator/src/modlog_combined_view.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Update crates/db_views_moderator/src/modlog_combined_view.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Addressing PR comments. * Fixing split. * Revert "Adding strum and simplifying imports." This reverts commit15f1671107
. * Running fmt. * Using assert + matches instead of filter_map. * Adding listPersonContent check. * Updating lemmy-js-client * Fixing mark all as read route, changing mark read to SuccessResponse. * Adding post body mention api test, fixing api tests. * Fixing route locations, and api tests. * Formatting sql. * Formatting sql 2. * Fixing search result, running clippy. * Fixing ts_option. * Adding search_combined.score column, and DB triggers. * Fixing API tests. * Adding an index for score. * Update crates/db_schema/src/newtypes.rs Co-authored-by: dullbananas <dull.bananas0@gmail.com> * Avoiding inner joins for up.sql * Adding person_aggregates.published column. --------- Co-authored-by: dullbananas <dull.bananas0@gmail.com>
This commit is contained in:
parent
aa3f4f07e3
commit
52047459bb
126 changed files with 2418 additions and 1183 deletions
47
Cargo.lock
generated
47
Cargo.lock
generated
|
@ -2566,8 +2566,6 @@ dependencies = [
|
||||||
"lemmy_api_crud",
|
"lemmy_api_crud",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"lemmy_db_views",
|
"lemmy_db_views",
|
||||||
"lemmy_db_views_actor",
|
|
||||||
"lemmy_db_views_moderator",
|
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
|
@ -2594,8 +2592,6 @@ dependencies = [
|
||||||
"jsonwebtoken",
|
"jsonwebtoken",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"lemmy_db_views",
|
"lemmy_db_views",
|
||||||
"lemmy_db_views_actor",
|
|
||||||
"lemmy_db_views_moderator",
|
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
"mime",
|
"mime",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
|
@ -2632,7 +2628,6 @@ dependencies = [
|
||||||
"lemmy_api_common",
|
"lemmy_api_common",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"lemmy_db_views",
|
"lemmy_db_views",
|
||||||
"lemmy_db_views_actor",
|
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -2662,7 +2657,6 @@ dependencies = [
|
||||||
"lemmy_api_common",
|
"lemmy_api_common",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"lemmy_db_views",
|
"lemmy_db_views",
|
||||||
"lemmy_db_views_actor",
|
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
"moka",
|
"moka",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
|
@ -2753,6 +2747,7 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with",
|
"serde_with",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
|
"strum",
|
||||||
"test-context",
|
"test-context",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
@ -2760,43 +2755,6 @@ dependencies = [
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lemmy_db_views_actor"
|
|
||||||
version = "0.19.6-beta.7"
|
|
||||||
dependencies = [
|
|
||||||
"chrono",
|
|
||||||
"diesel",
|
|
||||||
"diesel-async",
|
|
||||||
"i-love-jesus",
|
|
||||||
"lemmy_db_schema",
|
|
||||||
"lemmy_utils",
|
|
||||||
"pretty_assertions",
|
|
||||||
"serde",
|
|
||||||
"serde_with",
|
|
||||||
"serial_test",
|
|
||||||
"strum",
|
|
||||||
"tokio",
|
|
||||||
"ts-rs",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lemmy_db_views_moderator"
|
|
||||||
version = "0.19.6-beta.7"
|
|
||||||
dependencies = [
|
|
||||||
"diesel",
|
|
||||||
"diesel-async",
|
|
||||||
"i-love-jesus",
|
|
||||||
"lemmy_db_schema",
|
|
||||||
"lemmy_utils",
|
|
||||||
"pretty_assertions",
|
|
||||||
"serde",
|
|
||||||
"serde_with",
|
|
||||||
"serial_test",
|
|
||||||
"tokio",
|
|
||||||
"ts-rs",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemmy_federate"
|
name = "lemmy_federate"
|
||||||
version = "0.19.6-beta.7"
|
version = "0.19.6-beta.7"
|
||||||
|
@ -2812,7 +2770,7 @@ dependencies = [
|
||||||
"lemmy_api_common",
|
"lemmy_api_common",
|
||||||
"lemmy_apub",
|
"lemmy_apub",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"lemmy_db_views_actor",
|
"lemmy_db_views",
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
"mockall",
|
"mockall",
|
||||||
"moka",
|
"moka",
|
||||||
|
@ -2847,7 +2805,6 @@ dependencies = [
|
||||||
"lemmy_api_common",
|
"lemmy_api_common",
|
||||||
"lemmy_db_schema",
|
"lemmy_db_schema",
|
||||||
"lemmy_db_views",
|
"lemmy_db_views",
|
||||||
"lemmy_db_views_actor",
|
|
||||||
"lemmy_utils",
|
"lemmy_utils",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"prometheus",
|
"prometheus",
|
||||||
|
|
|
@ -49,8 +49,6 @@ members = [
|
||||||
"crates/db_perf",
|
"crates/db_perf",
|
||||||
"crates/db_schema",
|
"crates/db_schema",
|
||||||
"crates/db_views",
|
"crates/db_views",
|
||||||
"crates/db_views_actor",
|
|
||||||
"crates/db_views_actor",
|
|
||||||
"crates/routes",
|
"crates/routes",
|
||||||
"crates/federate",
|
"crates/federate",
|
||||||
]
|
]
|
||||||
|
@ -90,8 +88,6 @@ lemmy_db_schema = { version = "=0.19.6-beta.7", path = "./crates/db_schema" }
|
||||||
lemmy_api_common = { version = "=0.19.6-beta.7", path = "./crates/api_common" }
|
lemmy_api_common = { version = "=0.19.6-beta.7", path = "./crates/api_common" }
|
||||||
lemmy_routes = { version = "=0.19.6-beta.7", path = "./crates/routes" }
|
lemmy_routes = { version = "=0.19.6-beta.7", path = "./crates/routes" }
|
||||||
lemmy_db_views = { version = "=0.19.6-beta.7", path = "./crates/db_views" }
|
lemmy_db_views = { version = "=0.19.6-beta.7", path = "./crates/db_views" }
|
||||||
lemmy_db_views_actor = { version = "=0.19.6-beta.7", path = "./crates/db_views_actor" }
|
|
||||||
lemmy_db_views_moderator = { version = "=0.19.6-beta.7", path = "./crates/db_views_moderator" }
|
|
||||||
lemmy_federate = { version = "=0.19.6-beta.7", path = "./crates/federate" }
|
lemmy_federate = { version = "=0.19.6-beta.7", path = "./crates/federate" }
|
||||||
activitypub_federation = { version = "0.6.1", default-features = false, features = [
|
activitypub_federation = { version = "0.6.1", default-features = false, features = [
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
|
|
@ -22,16 +22,16 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.12",
|
"@types/jest": "^29.5.12",
|
||||||
"@types/node": "^22.10.6",
|
"@types/node": "^22.10.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
||||||
"@typescript-eslint/parser": "^8.20.0",
|
"@typescript-eslint/parser": "^8.21.0",
|
||||||
"eslint": "^9.18.0",
|
"eslint": "^9.18.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.2.3",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"lemmy-js-client": "0.20.0-inbox-combined.1",
|
"lemmy-js-client": "0.20.0-search-combined.1",
|
||||||
"prettier": "^3.4.2",
|
"prettier": "^3.4.2",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
"typescript-eslint": "^8.20.0"
|
"typescript-eslint": "^8.21.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,38 +12,38 @@ importers:
|
||||||
specifier: ^29.5.12
|
specifier: ^29.5.12
|
||||||
version: 29.5.14
|
version: 29.5.14
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^22.10.6
|
specifier: ^22.10.7
|
||||||
version: 22.10.6
|
version: 22.10.7
|
||||||
'@typescript-eslint/eslint-plugin':
|
'@typescript-eslint/eslint-plugin':
|
||||||
specifier: ^8.20.0
|
specifier: ^8.21.0
|
||||||
version: 8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)
|
version: 8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)
|
||||||
'@typescript-eslint/parser':
|
'@typescript-eslint/parser':
|
||||||
specifier: ^8.20.0
|
specifier: ^8.21.0
|
||||||
version: 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
version: 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^9.18.0
|
specifier: ^9.18.0
|
||||||
version: 9.18.0
|
version: 9.18.0
|
||||||
eslint-plugin-prettier:
|
eslint-plugin-prettier:
|
||||||
specifier: ^5.1.3
|
specifier: ^5.2.3
|
||||||
version: 5.2.1(eslint@9.18.0)(prettier@3.4.2)
|
version: 5.2.3(eslint@9.18.0)(prettier@3.4.2)
|
||||||
jest:
|
jest:
|
||||||
specifier: ^29.5.0
|
specifier: ^29.5.0
|
||||||
version: 29.7.0(@types/node@22.10.6)
|
version: 29.7.0(@types/node@22.10.7)
|
||||||
lemmy-js-client:
|
lemmy-js-client:
|
||||||
specifier: 0.20.0-inbox-combined.1
|
specifier: 0.20.0-search-combined.1
|
||||||
version: 0.20.0-inbox-combined.1
|
version: 0.20.0-search-combined.1
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^3.4.2
|
specifier: ^3.4.2
|
||||||
version: 3.4.2
|
version: 3.4.2
|
||||||
ts-jest:
|
ts-jest:
|
||||||
specifier: ^29.1.0
|
specifier: ^29.1.0
|
||||||
version: 29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.10.6))(typescript@5.7.3)
|
version: 29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.10.7))(typescript@5.7.3)
|
||||||
typescript:
|
typescript:
|
||||||
specifier: ^5.7.3
|
specifier: ^5.7.3
|
||||||
version: 5.7.3
|
version: 5.7.3
|
||||||
typescript-eslint:
|
typescript-eslint:
|
||||||
specifier: ^8.20.0
|
specifier: ^8.21.0
|
||||||
version: 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
version: 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
@ -422,8 +422,8 @@ packages:
|
||||||
'@types/json-schema@7.0.15':
|
'@types/json-schema@7.0.15':
|
||||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||||
|
|
||||||
'@types/node@22.10.6':
|
'@types/node@22.10.7':
|
||||||
resolution: {integrity: sha512-qNiuwC4ZDAUNcY47xgaSuS92cjf8JbSUoaKS77bmLG1rU7MlATVSiw/IlrjtIyyskXBZ8KkNfjK/P5na7rgXbQ==}
|
resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==}
|
||||||
|
|
||||||
'@types/stack-utils@2.0.3':
|
'@types/stack-utils@2.0.3':
|
||||||
resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==}
|
resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==}
|
||||||
|
@ -434,51 +434,51 @@ packages:
|
||||||
'@types/yargs@17.0.32':
|
'@types/yargs@17.0.32':
|
||||||
resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==}
|
resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==}
|
||||||
|
|
||||||
'@typescript-eslint/eslint-plugin@8.20.0':
|
'@typescript-eslint/eslint-plugin@8.21.0':
|
||||||
resolution: {integrity: sha512-naduuphVw5StFfqp4Gq4WhIBE2gN1GEmMUExpJYknZJdRnc+2gDzB8Z3+5+/Kv33hPQRDGzQO/0opHE72lZZ6A==}
|
resolution: {integrity: sha512-eTH+UOR4I7WbdQnG4Z48ebIA6Bgi7WO8HvFEneeYBxG8qCOYgTOFPSg6ek9ITIDvGjDQzWHcoWHCDO2biByNzA==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
|
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
|
||||||
eslint: ^8.57.0 || ^9.0.0
|
eslint: ^8.57.0 || ^9.0.0
|
||||||
typescript: '>=4.8.4 <5.8.0'
|
typescript: '>=4.8.4 <5.8.0'
|
||||||
|
|
||||||
'@typescript-eslint/parser@8.20.0':
|
'@typescript-eslint/parser@8.21.0':
|
||||||
resolution: {integrity: sha512-gKXG7A5HMyjDIedBi6bUrDcun8GIjnI8qOwVLiY3rx6T/sHP/19XLJOnIq/FgQvWLHja5JN/LSE7eklNBr612g==}
|
resolution: {integrity: sha512-Wy+/sdEH9kI3w9civgACwabHbKl+qIOu0uFZ9IMKzX3Jpv9og0ZBJrZExGrPpFAY7rWsXuxs5e7CPPP17A4eYA==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0
|
eslint: ^8.57.0 || ^9.0.0
|
||||||
typescript: '>=4.8.4 <5.8.0'
|
typescript: '>=4.8.4 <5.8.0'
|
||||||
|
|
||||||
'@typescript-eslint/scope-manager@8.20.0':
|
'@typescript-eslint/scope-manager@8.21.0':
|
||||||
resolution: {integrity: sha512-J7+VkpeGzhOt3FeG1+SzhiMj9NzGD/M6KoGn9f4dbz3YzK9hvbhVTmLj/HiTp9DazIzJ8B4XcM80LrR9Dm1rJw==}
|
resolution: {integrity: sha512-G3IBKz0/0IPfdeGRMbp+4rbjfSSdnGkXsM/pFZA8zM9t9klXDnB/YnKOBQ0GoPmoROa4bCq2NeHgJa5ydsQ4mA==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
|
|
||||||
'@typescript-eslint/type-utils@8.20.0':
|
'@typescript-eslint/type-utils@8.21.0':
|
||||||
resolution: {integrity: sha512-bPC+j71GGvA7rVNAHAtOjbVXbLN5PkwqMvy1cwGeaxUoRQXVuKCebRoLzm+IPW/NtFFpstn1ummSIasD5t60GA==}
|
resolution: {integrity: sha512-95OsL6J2BtzoBxHicoXHxgk3z+9P3BEcQTpBKriqiYzLKnM2DeSqs+sndMKdamU8FosiadQFT3D+BSL9EKnAJQ==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0
|
eslint: ^8.57.0 || ^9.0.0
|
||||||
typescript: '>=4.8.4 <5.8.0'
|
typescript: '>=4.8.4 <5.8.0'
|
||||||
|
|
||||||
'@typescript-eslint/types@8.20.0':
|
'@typescript-eslint/types@8.21.0':
|
||||||
resolution: {integrity: sha512-cqaMiY72CkP+2xZRrFt3ExRBu0WmVitN/rYPZErA80mHjHx/Svgp8yfbzkJmDoQ/whcytOPO9/IZXnOc+wigRA==}
|
resolution: {integrity: sha512-PAL6LUuQwotLW2a8VsySDBwYMm129vFm4tMVlylzdoTybTHaAi0oBp7Ac6LhSrHHOdLM3efH+nAR6hAWoMF89A==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
|
|
||||||
'@typescript-eslint/typescript-estree@8.20.0':
|
'@typescript-eslint/typescript-estree@8.21.0':
|
||||||
resolution: {integrity: sha512-Y7ncuy78bJqHI35NwzWol8E0X7XkRVS4K4P4TCyzWkOJih5NDvtoRDW4Ba9YJJoB2igm9yXDdYI/+fkiiAxPzA==}
|
resolution: {integrity: sha512-x+aeKh/AjAArSauz0GiQZsjT8ciadNMHdkUSwBB9Z6PrKc/4knM4g3UfHml6oDJmKC88a6//cdxnO/+P2LkMcg==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '>=4.8.4 <5.8.0'
|
typescript: '>=4.8.4 <5.8.0'
|
||||||
|
|
||||||
'@typescript-eslint/utils@8.20.0':
|
'@typescript-eslint/utils@8.21.0':
|
||||||
resolution: {integrity: sha512-dq70RUw6UK9ei7vxc4KQtBRk7qkHZv447OUZ6RPQMQl71I3NZxQJX/f32Smr+iqWrB02pHKn2yAdHBb0KNrRMA==}
|
resolution: {integrity: sha512-xcXBfcq0Kaxgj7dwejMbFyq7IOHgpNMtVuDveK7w3ZGwG9owKzhALVwKpTF2yrZmEwl9SWdetf3fxNzJQaVuxw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0
|
eslint: ^8.57.0 || ^9.0.0
|
||||||
typescript: '>=4.8.4 <5.8.0'
|
typescript: '>=4.8.4 <5.8.0'
|
||||||
|
|
||||||
'@typescript-eslint/visitor-keys@8.20.0':
|
'@typescript-eslint/visitor-keys@8.21.0':
|
||||||
resolution: {integrity: sha512-v/BpkeeYAsPkKCkR8BDwcno0llhzWVqPOamQrAEMdpZav2Y9OVjd9dwJyBLJWwf335B5DmlifECIkZRJCaGaHA==}
|
resolution: {integrity: sha512-BkLMNpdV6prozk8LlyK/SOoWLmUFi+ZD+pcqti9ILCbVvHGk1ui1g4jJOc2WDLaeExz2qWwojxlPce5PljcT3w==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
|
|
||||||
acorn-jsx@5.3.2:
|
acorn-jsx@5.3.2:
|
||||||
|
@ -709,8 +709,8 @@ packages:
|
||||||
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
eslint-plugin-prettier@5.2.1:
|
eslint-plugin-prettier@5.2.3:
|
||||||
resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==}
|
resolution: {integrity: sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==}
|
||||||
engines: {node: ^14.18.0 || >=16.0.0}
|
engines: {node: ^14.18.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@types/eslint': '>=8.0.0'
|
'@types/eslint': '>=8.0.0'
|
||||||
|
@ -1157,8 +1157,8 @@ packages:
|
||||||
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
|
|
||||||
lemmy-js-client@0.20.0-inbox-combined.1:
|
lemmy-js-client@0.20.0-search-combined.1:
|
||||||
resolution: {integrity: sha512-sFJJePXdMHIVQwCa3fN+nIcIvfD7ZbBEZn08fmITXEA6/qbJLvZGWG/rEcRNkZM+lRKnhfrZihWKx1AHZE9wqA==}
|
resolution: {integrity: sha512-K4bk6r+26lxZqL8WKiJlqfZb+ZnhNrZz1gAQTb4FQkGXQLFeqQ41ZyGmQZzjX+NPy7O9mt9d9d7zI8t/QYJ82Q==}
|
||||||
|
|
||||||
leven@3.1.0:
|
leven@3.1.0:
|
||||||
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
|
||||||
|
@ -1528,8 +1528,8 @@ packages:
|
||||||
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
|
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
typescript-eslint@8.20.0:
|
typescript-eslint@8.21.0:
|
||||||
resolution: {integrity: sha512-Kxz2QRFsgbWj6Xcftlw3Dd154b3cEPFqQC+qMZrMypSijPd4UanKKvoKDrJ4o8AIfZFKAF+7sMaEIR8mTElozA==}
|
resolution: {integrity: sha512-txEKYY4XMKwPXxNkN8+AxAdX6iIJAPiJbHE/FpQccs/sxw8Lf26kqwC3cn0xkHlW8kEbLhkhCsjWuMveaY9Rxw==}
|
||||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^8.57.0 || ^9.0.0
|
eslint: ^8.57.0 || ^9.0.0
|
||||||
|
@ -1869,7 +1869,7 @@ snapshots:
|
||||||
'@jest/console@29.7.0':
|
'@jest/console@29.7.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
jest-message-util: 29.7.0
|
jest-message-util: 29.7.0
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
|
@ -1882,14 +1882,14 @@ snapshots:
|
||||||
'@jest/test-result': 29.7.0
|
'@jest/test-result': 29.7.0
|
||||||
'@jest/transform': 29.7.0
|
'@jest/transform': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
ansi-escapes: 4.3.2
|
ansi-escapes: 4.3.2
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
ci-info: 3.9.0
|
ci-info: 3.9.0
|
||||||
exit: 0.1.2
|
exit: 0.1.2
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
jest-changed-files: 29.7.0
|
jest-changed-files: 29.7.0
|
||||||
jest-config: 29.7.0(@types/node@22.10.6)
|
jest-config: 29.7.0(@types/node@22.10.7)
|
||||||
jest-haste-map: 29.7.0
|
jest-haste-map: 29.7.0
|
||||||
jest-message-util: 29.7.0
|
jest-message-util: 29.7.0
|
||||||
jest-regex-util: 29.6.3
|
jest-regex-util: 29.6.3
|
||||||
|
@ -1914,7 +1914,7 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/fake-timers': 29.7.0
|
'@jest/fake-timers': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
jest-mock: 29.7.0
|
jest-mock: 29.7.0
|
||||||
|
|
||||||
'@jest/expect-utils@29.7.0':
|
'@jest/expect-utils@29.7.0':
|
||||||
|
@ -1932,7 +1932,7 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@sinonjs/fake-timers': 10.3.0
|
'@sinonjs/fake-timers': 10.3.0
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
jest-message-util: 29.7.0
|
jest-message-util: 29.7.0
|
||||||
jest-mock: 29.7.0
|
jest-mock: 29.7.0
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
|
@ -1954,7 +1954,7 @@ snapshots:
|
||||||
'@jest/transform': 29.7.0
|
'@jest/transform': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@jridgewell/trace-mapping': 0.3.22
|
'@jridgewell/trace-mapping': 0.3.22
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
collect-v8-coverage: 1.0.2
|
collect-v8-coverage: 1.0.2
|
||||||
exit: 0.1.2
|
exit: 0.1.2
|
||||||
|
@ -2024,7 +2024,7 @@ snapshots:
|
||||||
'@jest/schemas': 29.6.3
|
'@jest/schemas': 29.6.3
|
||||||
'@types/istanbul-lib-coverage': 2.0.6
|
'@types/istanbul-lib-coverage': 2.0.6
|
||||||
'@types/istanbul-reports': 3.0.4
|
'@types/istanbul-reports': 3.0.4
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
'@types/yargs': 17.0.32
|
'@types/yargs': 17.0.32
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
|
|
||||||
|
@ -2094,7 +2094,7 @@ snapshots:
|
||||||
|
|
||||||
'@types/graceful-fs@4.1.9':
|
'@types/graceful-fs@4.1.9':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
|
|
||||||
'@types/istanbul-lib-coverage@2.0.6': {}
|
'@types/istanbul-lib-coverage@2.0.6': {}
|
||||||
|
|
||||||
|
@ -2113,7 +2113,7 @@ snapshots:
|
||||||
|
|
||||||
'@types/json-schema@7.0.15': {}
|
'@types/json-schema@7.0.15': {}
|
||||||
|
|
||||||
'@types/node@22.10.6':
|
'@types/node@22.10.7':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 6.20.0
|
undici-types: 6.20.0
|
||||||
|
|
||||||
|
@ -2125,14 +2125,14 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/yargs-parser': 21.0.3
|
'@types/yargs-parser': 21.0.3
|
||||||
|
|
||||||
'@typescript-eslint/eslint-plugin@8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)':
|
'@typescript-eslint/eslint-plugin@8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@eslint-community/regexpp': 4.12.1
|
'@eslint-community/regexpp': 4.12.1
|
||||||
'@typescript-eslint/parser': 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/parser': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
'@typescript-eslint/scope-manager': 8.20.0
|
'@typescript-eslint/scope-manager': 8.21.0
|
||||||
'@typescript-eslint/type-utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/type-utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
'@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
'@typescript-eslint/visitor-keys': 8.20.0
|
'@typescript-eslint/visitor-keys': 8.21.0
|
||||||
eslint: 9.18.0
|
eslint: 9.18.0
|
||||||
graphemer: 1.4.0
|
graphemer: 1.4.0
|
||||||
ignore: 5.3.2
|
ignore: 5.3.2
|
||||||
|
@ -2142,27 +2142,27 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3)':
|
'@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/scope-manager': 8.20.0
|
'@typescript-eslint/scope-manager': 8.21.0
|
||||||
'@typescript-eslint/types': 8.20.0
|
'@typescript-eslint/types': 8.21.0
|
||||||
'@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3)
|
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
|
||||||
'@typescript-eslint/visitor-keys': 8.20.0
|
'@typescript-eslint/visitor-keys': 8.21.0
|
||||||
debug: 4.4.0
|
debug: 4.4.0
|
||||||
eslint: 9.18.0
|
eslint: 9.18.0
|
||||||
typescript: 5.7.3
|
typescript: 5.7.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/scope-manager@8.20.0':
|
'@typescript-eslint/scope-manager@8.21.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.20.0
|
'@typescript-eslint/types': 8.21.0
|
||||||
'@typescript-eslint/visitor-keys': 8.20.0
|
'@typescript-eslint/visitor-keys': 8.21.0
|
||||||
|
|
||||||
'@typescript-eslint/type-utils@8.20.0(eslint@9.18.0)(typescript@5.7.3)':
|
'@typescript-eslint/type-utils@8.21.0(eslint@9.18.0)(typescript@5.7.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3)
|
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
|
||||||
'@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
debug: 4.4.0
|
debug: 4.4.0
|
||||||
eslint: 9.18.0
|
eslint: 9.18.0
|
||||||
ts-api-utils: 2.0.0(typescript@5.7.3)
|
ts-api-utils: 2.0.0(typescript@5.7.3)
|
||||||
|
@ -2170,12 +2170,12 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/types@8.20.0': {}
|
'@typescript-eslint/types@8.21.0': {}
|
||||||
|
|
||||||
'@typescript-eslint/typescript-estree@8.20.0(typescript@5.7.3)':
|
'@typescript-eslint/typescript-estree@8.21.0(typescript@5.7.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.20.0
|
'@typescript-eslint/types': 8.21.0
|
||||||
'@typescript-eslint/visitor-keys': 8.20.0
|
'@typescript-eslint/visitor-keys': 8.21.0
|
||||||
debug: 4.4.0
|
debug: 4.4.0
|
||||||
fast-glob: 3.3.3
|
fast-glob: 3.3.3
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
|
@ -2186,20 +2186,20 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/utils@8.20.0(eslint@9.18.0)(typescript@5.7.3)':
|
'@typescript-eslint/utils@8.21.0(eslint@9.18.0)(typescript@5.7.3)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0)
|
'@eslint-community/eslint-utils': 4.4.1(eslint@9.18.0)
|
||||||
'@typescript-eslint/scope-manager': 8.20.0
|
'@typescript-eslint/scope-manager': 8.21.0
|
||||||
'@typescript-eslint/types': 8.20.0
|
'@typescript-eslint/types': 8.21.0
|
||||||
'@typescript-eslint/typescript-estree': 8.20.0(typescript@5.7.3)
|
'@typescript-eslint/typescript-estree': 8.21.0(typescript@5.7.3)
|
||||||
eslint: 9.18.0
|
eslint: 9.18.0
|
||||||
typescript: 5.7.3
|
typescript: 5.7.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@typescript-eslint/visitor-keys@8.20.0':
|
'@typescript-eslint/visitor-keys@8.21.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.20.0
|
'@typescript-eslint/types': 8.21.0
|
||||||
eslint-visitor-keys: 4.2.0
|
eslint-visitor-keys: 4.2.0
|
||||||
|
|
||||||
acorn-jsx@5.3.2(acorn@8.14.0):
|
acorn-jsx@5.3.2(acorn@8.14.0):
|
||||||
|
@ -2367,13 +2367,13 @@ snapshots:
|
||||||
|
|
||||||
convert-source-map@2.0.0: {}
|
convert-source-map@2.0.0: {}
|
||||||
|
|
||||||
create-jest@29.7.0(@types/node@22.10.6):
|
create-jest@29.7.0(@types/node@22.10.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
exit: 0.1.2
|
exit: 0.1.2
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
jest-config: 29.7.0(@types/node@22.10.6)
|
jest-config: 29.7.0(@types/node@22.10.7)
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
prompts: 2.4.2
|
prompts: 2.4.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
|
@ -2428,7 +2428,7 @@ snapshots:
|
||||||
|
|
||||||
escape-string-regexp@4.0.0: {}
|
escape-string-regexp@4.0.0: {}
|
||||||
|
|
||||||
eslint-plugin-prettier@5.2.1(eslint@9.18.0)(prettier@3.4.2):
|
eslint-plugin-prettier@5.2.3(eslint@9.18.0)(prettier@3.4.2):
|
||||||
dependencies:
|
dependencies:
|
||||||
eslint: 9.18.0
|
eslint: 9.18.0
|
||||||
prettier: 3.4.2
|
prettier: 3.4.2
|
||||||
|
@ -2735,7 +2735,7 @@ snapshots:
|
||||||
'@jest/expect': 29.7.0
|
'@jest/expect': 29.7.0
|
||||||
'@jest/test-result': 29.7.0
|
'@jest/test-result': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
co: 4.6.0
|
co: 4.6.0
|
||||||
dedent: 1.5.1
|
dedent: 1.5.1
|
||||||
|
@ -2755,16 +2755,16 @@ snapshots:
|
||||||
- babel-plugin-macros
|
- babel-plugin-macros
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
jest-cli@29.7.0(@types/node@22.10.6):
|
jest-cli@29.7.0(@types/node@22.10.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/core': 29.7.0
|
'@jest/core': 29.7.0
|
||||||
'@jest/test-result': 29.7.0
|
'@jest/test-result': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
create-jest: 29.7.0(@types/node@22.10.6)
|
create-jest: 29.7.0(@types/node@22.10.7)
|
||||||
exit: 0.1.2
|
exit: 0.1.2
|
||||||
import-local: 3.1.0
|
import-local: 3.1.0
|
||||||
jest-config: 29.7.0(@types/node@22.10.6)
|
jest-config: 29.7.0(@types/node@22.10.7)
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
jest-validate: 29.7.0
|
jest-validate: 29.7.0
|
||||||
yargs: 17.7.2
|
yargs: 17.7.2
|
||||||
|
@ -2774,7 +2774,7 @@ snapshots:
|
||||||
- supports-color
|
- supports-color
|
||||||
- ts-node
|
- ts-node
|
||||||
|
|
||||||
jest-config@29.7.0(@types/node@22.10.6):
|
jest-config@29.7.0(@types/node@22.10.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@babel/core': 7.23.9
|
'@babel/core': 7.23.9
|
||||||
'@jest/test-sequencer': 29.7.0
|
'@jest/test-sequencer': 29.7.0
|
||||||
|
@ -2799,7 +2799,7 @@ snapshots:
|
||||||
slash: 3.0.0
|
slash: 3.0.0
|
||||||
strip-json-comments: 3.1.1
|
strip-json-comments: 3.1.1
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- babel-plugin-macros
|
- babel-plugin-macros
|
||||||
- supports-color
|
- supports-color
|
||||||
|
@ -2828,7 +2828,7 @@ snapshots:
|
||||||
'@jest/environment': 29.7.0
|
'@jest/environment': 29.7.0
|
||||||
'@jest/fake-timers': 29.7.0
|
'@jest/fake-timers': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
jest-mock: 29.7.0
|
jest-mock: 29.7.0
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
|
|
||||||
|
@ -2838,7 +2838,7 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/graceful-fs': 4.1.9
|
'@types/graceful-fs': 4.1.9
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
anymatch: 3.1.3
|
anymatch: 3.1.3
|
||||||
fb-watchman: 2.0.2
|
fb-watchman: 2.0.2
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
|
@ -2877,7 +2877,7 @@ snapshots:
|
||||||
jest-mock@29.7.0:
|
jest-mock@29.7.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
|
|
||||||
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
|
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
|
||||||
|
@ -2912,7 +2912,7 @@ snapshots:
|
||||||
'@jest/test-result': 29.7.0
|
'@jest/test-result': 29.7.0
|
||||||
'@jest/transform': 29.7.0
|
'@jest/transform': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
emittery: 0.13.1
|
emittery: 0.13.1
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
|
@ -2940,7 +2940,7 @@ snapshots:
|
||||||
'@jest/test-result': 29.7.0
|
'@jest/test-result': 29.7.0
|
||||||
'@jest/transform': 29.7.0
|
'@jest/transform': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
cjs-module-lexer: 1.2.3
|
cjs-module-lexer: 1.2.3
|
||||||
collect-v8-coverage: 1.0.2
|
collect-v8-coverage: 1.0.2
|
||||||
|
@ -2986,7 +2986,7 @@ snapshots:
|
||||||
jest-util@29.7.0:
|
jest-util@29.7.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
ci-info: 3.9.0
|
ci-info: 3.9.0
|
||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
|
@ -3005,7 +3005,7 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/test-result': 29.7.0
|
'@jest/test-result': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
ansi-escapes: 4.3.2
|
ansi-escapes: 4.3.2
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
emittery: 0.13.1
|
emittery: 0.13.1
|
||||||
|
@ -3014,17 +3014,17 @@ snapshots:
|
||||||
|
|
||||||
jest-worker@29.7.0:
|
jest-worker@29.7.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 22.10.6
|
'@types/node': 22.10.7
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
merge-stream: 2.0.0
|
merge-stream: 2.0.0
|
||||||
supports-color: 8.1.1
|
supports-color: 8.1.1
|
||||||
|
|
||||||
jest@29.7.0(@types/node@22.10.6):
|
jest@29.7.0(@types/node@22.10.7):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jest/core': 29.7.0
|
'@jest/core': 29.7.0
|
||||||
'@jest/types': 29.6.3
|
'@jest/types': 29.6.3
|
||||||
import-local: 3.1.0
|
import-local: 3.1.0
|
||||||
jest-cli: 29.7.0(@types/node@22.10.6)
|
jest-cli: 29.7.0(@types/node@22.10.7)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@types/node'
|
- '@types/node'
|
||||||
- babel-plugin-macros
|
- babel-plugin-macros
|
||||||
|
@ -3060,7 +3060,7 @@ snapshots:
|
||||||
|
|
||||||
kleur@3.0.3: {}
|
kleur@3.0.3: {}
|
||||||
|
|
||||||
lemmy-js-client@0.20.0-inbox-combined.1: {}
|
lemmy-js-client@0.20.0-search-combined.1: {}
|
||||||
|
|
||||||
leven@3.1.0: {}
|
leven@3.1.0: {}
|
||||||
|
|
||||||
|
@ -3339,12 +3339,12 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
typescript: 5.7.3
|
typescript: 5.7.3
|
||||||
|
|
||||||
ts-jest@29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.10.6))(typescript@5.7.3):
|
ts-jest@29.2.5(@babel/core@7.23.9)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.9))(jest@29.7.0(@types/node@22.10.7))(typescript@5.7.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
bs-logger: 0.2.6
|
bs-logger: 0.2.6
|
||||||
ejs: 3.1.10
|
ejs: 3.1.10
|
||||||
fast-json-stable-stringify: 2.1.0
|
fast-json-stable-stringify: 2.1.0
|
||||||
jest: 29.7.0(@types/node@22.10.6)
|
jest: 29.7.0(@types/node@22.10.7)
|
||||||
jest-util: 29.7.0
|
jest-util: 29.7.0
|
||||||
json5: 2.2.3
|
json5: 2.2.3
|
||||||
lodash.memoize: 4.1.2
|
lodash.memoize: 4.1.2
|
||||||
|
@ -3368,11 +3368,11 @@ snapshots:
|
||||||
|
|
||||||
type-fest@0.21.3: {}
|
type-fest@0.21.3: {}
|
||||||
|
|
||||||
typescript-eslint@8.20.0(eslint@9.18.0)(typescript@5.7.3):
|
typescript-eslint@8.21.0(eslint@9.18.0)(typescript@5.7.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/eslint-plugin': 8.20.0(@typescript-eslint/parser@8.20.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/eslint-plugin': 8.21.0(@typescript-eslint/parser@8.21.0(eslint@9.18.0)(typescript@5.7.3))(eslint@9.18.0)(typescript@5.7.3)
|
||||||
'@typescript-eslint/parser': 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/parser': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
'@typescript-eslint/utils': 8.20.0(eslint@9.18.0)(typescript@5.7.3)
|
'@typescript-eslint/utils': 8.21.0(eslint@9.18.0)(typescript@5.7.3)
|
||||||
eslint: 9.18.0
|
eslint: 9.18.0
|
||||||
typescript: 5.7.3
|
typescript: 5.7.3
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
|
|
|
@ -9,7 +9,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
export RUST_LOG="warn,lemmy_server=$LEMMY_LOG_LEVEL,lemmy_federate=$LEMMY_LOG_LEVEL,lemmy_api=$LEMMY_LOG_LEVEL,lemmy_api_common=$LEMMY_LOG_LEVEL,lemmy_api_crud=$LEMMY_LOG_LEVEL,lemmy_apub=$LEMMY_LOG_LEVEL,lemmy_db_schema=$LEMMY_LOG_LEVEL,lemmy_db_views=$LEMMY_LOG_LEVEL,lemmy_db_views_actor=$LEMMY_LOG_LEVEL,lemmy_db_views_moderator=$LEMMY_LOG_LEVEL,lemmy_routes=$LEMMY_LOG_LEVEL,lemmy_utils=$LEMMY_LOG_LEVEL,lemmy_websocket=$LEMMY_LOG_LEVEL"
|
export RUST_LOG="warn,lemmy_server=$LEMMY_LOG_LEVEL,lemmy_federate=$LEMMY_LOG_LEVEL,lemmy_api=$LEMMY_LOG_LEVEL,lemmy_api_common=$LEMMY_LOG_LEVEL,lemmy_api_crud=$LEMMY_LOG_LEVEL,lemmy_apub=$LEMMY_LOG_LEVEL,lemmy_db_schema=$LEMMY_LOG_LEVEL,lemmy_db_views=$LEMMY_LOG_LEVEL,lemmy_routes=$LEMMY_LOG_LEVEL,lemmy_utils=$LEMMY_LOG_LEVEL,lemmy_websocket=$LEMMY_LOG_LEVEL"
|
||||||
|
|
||||||
export LEMMY_TEST_FAST_FEDERATION=1 # by default, the persistent federation queue has delays in the scale of 30s-5min
|
export LEMMY_TEST_FAST_FEDERATION=1 # by default, the persistent federation queue has delays in the scale of 30s-5min
|
||||||
|
|
||||||
|
|
|
@ -488,7 +488,7 @@ test("Dont receive community activities after unsubscribe", async () => {
|
||||||
// await longDelay();
|
// await longDelay();
|
||||||
|
|
||||||
let postResBeta = searchPostLocal(beta, postRes.post_view.post);
|
let postResBeta = searchPostLocal(beta, postRes.post_view.post);
|
||||||
expect((await postResBeta).posts.length).toBe(0);
|
expect((await postResBeta).results.length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Fetch community, includes posts", async () => {
|
test("Fetch community, includes posts", async () => {
|
||||||
|
|
|
@ -324,9 +324,8 @@ export async function searchPostLocal(
|
||||||
post: Post,
|
post: Post,
|
||||||
): Promise<SearchResponse> {
|
): Promise<SearchResponse> {
|
||||||
let form: Search = {
|
let form: Search = {
|
||||||
q: post.name,
|
search_term: post.name,
|
||||||
type_: "Posts",
|
type_: "Posts",
|
||||||
sort: "TopAll",
|
|
||||||
listing_type: "All",
|
listing_type: "All",
|
||||||
};
|
};
|
||||||
return api.search(form);
|
return api.search(form);
|
||||||
|
@ -339,7 +338,7 @@ export async function waitForPost(
|
||||||
checker: (t: PostView | undefined) => boolean = p => !!p,
|
checker: (t: PostView | undefined) => boolean = p => !!p,
|
||||||
) {
|
) {
|
||||||
return waitUntil<PostView>(
|
return waitUntil<PostView>(
|
||||||
() => searchPostLocal(api, post).then(p => p.posts[0]),
|
() => searchPostLocal(api, post).then(p => p.results[0] as PostView),
|
||||||
checker,
|
checker,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,6 @@ workspace = true
|
||||||
lemmy_utils = { workspace = true }
|
lemmy_utils = { workspace = true }
|
||||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views = { workspace = true, features = ["full"] }
|
lemmy_db_views = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views_moderator = { workspace = true, features = ["full"] }
|
|
||||||
lemmy_db_views_actor = { workspace = true, features = ["full"] }
|
|
||||||
lemmy_api_common = { workspace = true, features = ["full"] }
|
lemmy_api_common = { workspace = true, features = ["full"] }
|
||||||
activitypub_federation = { workspace = true }
|
activitypub_federation = { workspace = true }
|
||||||
bcrypt = { workspace = true }
|
bcrypt = { workspace = true }
|
||||||
|
|
|
@ -14,8 +14,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::{Crud, Joinable},
|
traits::{Crud, Joinable},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -24,8 +24,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::{Bannable, Crud, Followable},
|
traits::{Bannable, Crud, Followable},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
||||||
utils::validation::is_valid_body_field,
|
utils::validation::is_valid_body_field,
|
||||||
|
|
|
@ -12,8 +12,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::{Blockable, Followable},
|
traits::{Blockable, Followable},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -14,8 +14,7 @@ use lemmy_db_schema::{
|
||||||
traits::{Crud, Followable},
|
traits::{Crud, Followable},
|
||||||
CommunityVisibility,
|
CommunityVisibility,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityPersonBanView, CommunityView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityPersonBanView, CommunityView};
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -4,8 +4,7 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::is_mod_or_admin,
|
utils::is_mod_or_admin,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityFollowerView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
pub async fn get_pending_follows_count(
|
pub async fn get_pending_follows_count(
|
||||||
|
|
|
@ -4,8 +4,7 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::check_community_mod_of_any_or_admin_action,
|
utils::check_community_mod_of_any_or_admin_action,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityFollowerView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
pub async fn get_pending_follows_list(
|
pub async fn get_pending_follows_list(
|
||||||
|
|
|
@ -10,8 +10,7 @@ use lemmy_db_schema::source::{
|
||||||
community::Community,
|
community::Community,
|
||||||
local_site::LocalSite,
|
local_site::LocalSite,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityView;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -12,8 +12,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::{Crud, Joinable},
|
traits::{Crud, Joinable},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityModeratorView, CommunityView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
||||||
location_info,
|
location_info,
|
||||||
|
|
|
@ -11,8 +11,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -16,8 +16,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
||||||
utils::validation::is_valid_body_field,
|
utils::validation::is_valid_body_field,
|
||||||
|
|
|
@ -7,8 +7,7 @@ use lemmy_db_schema::{
|
||||||
source::person_block::{PersonBlock, PersonBlockForm},
|
source::person_block::{PersonBlock, PersonBlockForm},
|
||||||
traits::Blockable,
|
traits::Blockable,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use actix_web::web::{Data, Json};
|
use actix_web::web::{Data, Json};
|
||||||
use lemmy_api_common::{context::LemmyContext, person::BannedPersonsResponse, utils::is_admin};
|
use lemmy_api_common::{context::LemmyContext, person::BannedPersonsResponse, utils::is_admin};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PersonView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
pub async fn list_banned_users(
|
pub async fn list_banned_users(
|
||||||
|
|
|
@ -6,7 +6,7 @@ use lemmy_api_common::{
|
||||||
utils::check_private_instance,
|
utils::check_private_instance,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
person_saved_combined_view::PersonSavedCombinedQuery,
|
combined::person_saved_combined_view::PersonSavedCombinedQuery,
|
||||||
structs::{LocalUserView, SiteView},
|
structs::{LocalUserView, SiteView},
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
|
@ -3,8 +3,7 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
person::{ListInbox, ListInboxResponse},
|
person::{ListInbox, ListInboxResponse},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::{combined::inbox_combined_view::InboxCombinedQuery, structs::LocalUserView};
|
||||||
use lemmy_db_views_actor::inbox_combined_view::InboxCombinedQuery;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use actix_web::web::{Data, Json};
|
use actix_web::web::{Data, Json};
|
||||||
use lemmy_api_common::{context::LemmyContext, person::GetUnreadCountResponse};
|
use lemmy_api_common::{context::LemmyContext, person::GetUnreadCountResponse};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{InboxCombinedViewInternal, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::InboxCombinedViewInternal;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -4,7 +4,7 @@ use lemmy_api_common::{
|
||||||
reports::combined::{ListReports, ListReportsResponse},
|
reports::combined::{ListReports, ListReportsResponse},
|
||||||
utils::check_community_mod_of_any_or_admin_action,
|
utils::check_community_mod_of_any_or_admin_action,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{report_combined_view::ReportCombinedQuery, structs::LocalUserView};
|
use lemmy_db_views::{combined::report_combined_view::ReportCombinedQuery, structs::LocalUserView};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
/// Lists reports for a community if an id is supplied
|
/// Lists reports for a community if an id is supplied
|
||||||
|
|
|
@ -12,8 +12,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
use lemmy_db_views::structs::{LocalUserView, PersonView, SiteView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorType, LemmyResult},
|
error::{LemmyErrorType, LemmyResult},
|
||||||
VERSION,
|
VERSION,
|
||||||
|
|
|
@ -5,8 +5,7 @@ use lemmy_api_common::{
|
||||||
utils::{check_community_mod_of_any_or_admin_action, check_private_instance},
|
utils::{check_community_mod_of_any_or_admin_action, check_private_instance},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::{combined::modlog_combined_view::ModlogCombinedQuery, structs::LocalUserView};
|
||||||
use lemmy_db_views_moderator::{self, modlog_combined_view::ModlogCombinedQuery};
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -17,8 +17,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -7,7 +7,7 @@ use lemmy_api_common::{
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::source::local_site::LocalSite;
|
use lemmy_db_schema::source::local_site::LocalSite;
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
registration_application_view::RegistrationApplicationQuery,
|
registration_applications::registration_application_view::RegistrationApplicationQuery,
|
||||||
structs::LocalUserView,
|
structs::LocalUserView,
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
|
@ -21,8 +21,6 @@ full = [
|
||||||
"tracing",
|
"tracing",
|
||||||
"rosetta-i18n",
|
"rosetta-i18n",
|
||||||
"lemmy_db_views/full",
|
"lemmy_db_views/full",
|
||||||
"lemmy_db_views_actor/full",
|
|
||||||
"lemmy_db_views_moderator/full",
|
|
||||||
"lemmy_utils/full",
|
"lemmy_utils/full",
|
||||||
"activitypub_federation",
|
"activitypub_federation",
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
|
@ -43,8 +41,6 @@ full = [
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lemmy_db_views = { workspace = true }
|
lemmy_db_views = { workspace = true }
|
||||||
lemmy_db_views_moderator = { workspace = true }
|
|
||||||
lemmy_db_views_actor = { workspace = true }
|
|
||||||
lemmy_db_schema = { workspace = true }
|
lemmy_db_schema = { workspace = true }
|
||||||
lemmy_utils = { workspace = true }
|
lemmy_utils = { workspace = true }
|
||||||
activitypub_federation = { workspace = true, optional = true }
|
activitypub_federation = { workspace = true, optional = true }
|
||||||
|
|
|
@ -25,8 +25,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView, PostView};
|
use lemmy_db_views::structs::{CommentView, CommunityView, LocalUserView, PostView};
|
||||||
use lemmy_db_views_actor::structs::CommunityView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::LemmyResult,
|
error::LemmyResult,
|
||||||
utils::{markdown::markdown_to_html, mention::MentionData},
|
utils::{markdown::markdown_to_html, mention::MentionData},
|
||||||
|
|
|
@ -4,7 +4,7 @@ use lemmy_db_schema::{
|
||||||
CommunityVisibility,
|
CommunityVisibility,
|
||||||
ListingType,
|
ListingType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::{
|
use lemmy_db_views::structs::{
|
||||||
CommunityModeratorView,
|
CommunityModeratorView,
|
||||||
CommunitySortType,
|
CommunitySortType,
|
||||||
CommunityView,
|
CommunityView,
|
||||||
|
|
|
@ -24,8 +24,6 @@ pub mod utils;
|
||||||
|
|
||||||
pub extern crate lemmy_db_schema;
|
pub extern crate lemmy_db_schema;
|
||||||
pub extern crate lemmy_db_views;
|
pub extern crate lemmy_db_views;
|
||||||
pub extern crate lemmy_db_views_actor;
|
|
||||||
pub extern crate lemmy_db_views_moderator;
|
|
||||||
pub extern crate lemmy_utils;
|
pub extern crate lemmy_utils;
|
||||||
|
|
||||||
pub use lemmy_utils::error::LemmyErrorType;
|
pub use lemmy_utils::error::LemmyErrorType;
|
||||||
|
|
|
@ -17,15 +17,13 @@ use lemmy_db_schema::{
|
||||||
PostSortType,
|
PostSortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{
|
use lemmy_db_views::structs::{
|
||||||
|
CommunityModeratorView,
|
||||||
|
InboxCombinedPaginationCursor,
|
||||||
|
InboxCombinedView,
|
||||||
LocalImageView,
|
LocalImageView,
|
||||||
PersonContentCombinedPaginationCursor,
|
PersonContentCombinedPaginationCursor,
|
||||||
PersonContentCombinedView,
|
PersonContentCombinedView,
|
||||||
PersonSavedCombinedPaginationCursor,
|
PersonSavedCombinedPaginationCursor,
|
||||||
};
|
|
||||||
use lemmy_db_views_actor::structs::{
|
|
||||||
CommunityModeratorView,
|
|
||||||
InboxCombinedPaginationCursor,
|
|
||||||
InboxCombinedView,
|
|
||||||
PersonView,
|
PersonView,
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
|
@ -4,8 +4,13 @@ use lemmy_db_schema::{
|
||||||
PostFeatureType,
|
PostFeatureType,
|
||||||
PostSortType,
|
PostSortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{PaginationCursor, PostView, VoteView};
|
use lemmy_db_views::structs::{
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
CommunityModeratorView,
|
||||||
|
CommunityView,
|
||||||
|
PaginationCursor,
|
||||||
|
PostView,
|
||||||
|
VoteView,
|
||||||
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::skip_serializing_none;
|
use serde_with::skip_serializing_none;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use lemmy_db_schema::newtypes::{PersonId, PrivateMessageId};
|
use lemmy_db_schema::newtypes::{PersonId, PrivateMessageId};
|
||||||
use lemmy_db_views_actor::structs::PrivateMessageView;
|
use lemmy_db_views::structs::PrivateMessageView;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
use ts_rs::TS;
|
use ts_rs::TS;
|
||||||
|
|
|
@ -11,7 +11,7 @@ use lemmy_db_schema::{
|
||||||
private_message::PrivateMessage,
|
private_message::PrivateMessage,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::PrivateMessageView;
|
use lemmy_db_views::structs::PrivateMessageView;
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
use std::sync::{LazyLock, OnceLock};
|
use std::sync::{LazyLock, OnceLock};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
|
|
|
@ -27,22 +27,24 @@ use lemmy_db_schema::{
|
||||||
PostListingMode,
|
PostListingMode,
|
||||||
PostSortType,
|
PostSortType,
|
||||||
RegistrationMode,
|
RegistrationMode,
|
||||||
|
SearchSortType,
|
||||||
SearchType,
|
SearchType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{
|
use lemmy_db_views::structs::{
|
||||||
CommentView,
|
CommentView,
|
||||||
LocalUserView,
|
|
||||||
PostView,
|
|
||||||
RegistrationApplicationView,
|
|
||||||
SiteView,
|
|
||||||
};
|
|
||||||
use lemmy_db_views_actor::structs::{
|
|
||||||
CommunityFollowerView,
|
CommunityFollowerView,
|
||||||
CommunityModeratorView,
|
CommunityModeratorView,
|
||||||
CommunityView,
|
CommunityView,
|
||||||
|
LocalUserView,
|
||||||
|
ModlogCombinedPaginationCursor,
|
||||||
|
ModlogCombinedView,
|
||||||
PersonView,
|
PersonView,
|
||||||
|
PostView,
|
||||||
|
RegistrationApplicationView,
|
||||||
|
SearchCombinedPaginationCursor,
|
||||||
|
SearchCombinedView,
|
||||||
|
SiteView,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_moderator::structs::{ModlogCombinedPaginationCursor, ModlogCombinedView};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::skip_serializing_none;
|
use serde_with::skip_serializing_none;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
|
@ -52,9 +54,10 @@ use ts_rs::TS;
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
||||||
#[cfg_attr(feature = "full", derive(TS))]
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
#[cfg_attr(feature = "full", ts(export))]
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
/// Searches the site, given a query string, and some optional filters.
|
/// Searches the site, given a search term, and some optional filters.
|
||||||
pub struct Search {
|
pub struct Search {
|
||||||
pub q: String,
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
pub search_term: Option<String>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub community_id: Option<CommunityId>,
|
pub community_id: Option<CommunityId>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
@ -64,14 +67,10 @@ pub struct Search {
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub type_: Option<SearchType>,
|
pub type_: Option<SearchType>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub sort: Option<PostSortType>,
|
pub sort: Option<SearchSortType>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub listing_type: Option<ListingType>,
|
pub listing_type: Option<ListingType>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub page: Option<i64>,
|
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
|
||||||
pub limit: Option<i64>,
|
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
|
||||||
pub title_only: Option<bool>,
|
pub title_only: Option<bool>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub post_url_only: Option<bool>,
|
pub post_url_only: Option<bool>,
|
||||||
|
@ -79,19 +78,18 @@ pub struct Search {
|
||||||
pub liked_only: Option<bool>,
|
pub liked_only: Option<bool>,
|
||||||
#[cfg_attr(feature = "full", ts(optional))]
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
pub disliked_only: Option<bool>,
|
pub disliked_only: Option<bool>,
|
||||||
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
pub page_cursor: Option<SearchCombinedPaginationCursor>,
|
||||||
|
#[cfg_attr(feature = "full", ts(optional))]
|
||||||
|
pub page_back: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
#[cfg_attr(feature = "full", derive(TS))]
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
#[cfg_attr(feature = "full", ts(export))]
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
/// The search response, containing lists of the return type possibilities
|
/// The search response, containing lists of the return type possibilities
|
||||||
// TODO this should be redone as a list of tagged enums
|
|
||||||
pub struct SearchResponse {
|
pub struct SearchResponse {
|
||||||
pub type_: SearchType,
|
pub results: Vec<SearchCombinedView>,
|
||||||
pub comments: Vec<CommentView>,
|
|
||||||
pub posts: Vec<PostView>,
|
|
||||||
pub communities: Vec<CommunityView>,
|
|
||||||
pub users: Vec<PersonView>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq, Eq, Hash)]
|
||||||
|
|
|
@ -47,14 +47,16 @@ use lemmy_db_schema::{
|
||||||
RegistrationMode,
|
RegistrationMode,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
comment_view::CommentQuery,
|
comment::comment_view::CommentQuery,
|
||||||
structs::{LocalImageView, LocalUserView, SiteView},
|
structs::{
|
||||||
};
|
CommunityFollowerView,
|
||||||
use lemmy_db_views_actor::structs::{
|
CommunityModeratorView,
|
||||||
CommunityFollowerView,
|
CommunityPersonBanView,
|
||||||
CommunityModeratorView,
|
CommunityView,
|
||||||
CommunityPersonBanView,
|
LocalImageView,
|
||||||
CommunityView,
|
LocalUserView,
|
||||||
|
SiteView,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
email::{send_email, translations::Lang},
|
email::{send_email, translations::Lang},
|
||||||
|
@ -1213,8 +1215,8 @@ mod tests {
|
||||||
},
|
},
|
||||||
ModlogActionType,
|
ModlogActionType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_moderator::{
|
use lemmy_db_views::{
|
||||||
modlog_combined_view::ModlogCombinedQuery,
|
combined::modlog_combined_view::ModlogCombinedQuery,
|
||||||
structs::{ModRemoveCommentView, ModRemovePostView, ModlogCombinedView},
|
structs::{ModRemoveCommentView, ModRemovePostView, ModlogCombinedView},
|
||||||
};
|
};
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
|
@ -16,7 +16,6 @@ workspace = true
|
||||||
lemmy_utils = { workspace = true, features = ["full"] }
|
lemmy_utils = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views = { workspace = true, features = ["full"] }
|
lemmy_db_views = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views_actor = { workspace = true, features = ["full"] }
|
|
||||||
lemmy_api_common = { workspace = true, features = ["full"] }
|
lemmy_api_common = { workspace = true, features = ["full"] }
|
||||||
activitypub_federation = { workspace = true }
|
activitypub_federation = { workspace = true }
|
||||||
bcrypt = { workspace = true }
|
bcrypt = { workspace = true }
|
||||||
|
|
|
@ -11,8 +11,7 @@ use lemmy_db_schema::{
|
||||||
source::community::{Community, CommunityUpdateForm},
|
source::community::{Community, CommunityUpdateForm},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -4,8 +4,10 @@ use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
utils::{check_private_instance, is_admin},
|
utils::{check_private_instance, is_admin},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
use lemmy_db_views::{
|
||||||
use lemmy_db_views_actor::community_view::CommunityQuery;
|
community::community_view::CommunityQuery,
|
||||||
|
structs::{LocalUserView, SiteView},
|
||||||
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -27,8 +27,7 @@ use lemmy_db_schema::{
|
||||||
traits::{Crud, Likeable},
|
traits::{Crud, Likeable},
|
||||||
utils::diesel_url_create,
|
utils::diesel_url_create,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
||||||
utils::{
|
utils::{
|
||||||
|
|
|
@ -12,10 +12,9 @@ use lemmy_db_schema::{
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
post_view::PostQuery,
|
post::post_view::PostQuery,
|
||||||
structs::{LocalUserView, PostView, SiteView},
|
structs::{CommunityModeratorView, CommunityView, LocalUserView, PostView, SiteView},
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -21,8 +21,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PrivateMessageView};
|
||||||
use lemmy_db_views_actor::structs::PrivateMessageView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
||||||
utils::{markdown::markdown_to_html, validation::is_valid_body_field},
|
utils::{markdown::markdown_to_html, validation::is_valid_body_field},
|
||||||
|
|
|
@ -9,8 +9,7 @@ use lemmy_db_schema::{
|
||||||
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
source::private_message::{PrivateMessage, PrivateMessageUpdateForm},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PrivateMessageView};
|
||||||
use lemmy_db_views_actor::structs::PrivateMessageView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -14,8 +14,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{LocalUserView, PrivateMessageView};
|
||||||
use lemmy_db_views_actor::structs::PrivateMessageView;
|
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
error::{LemmyErrorExt, LemmyErrorType, LemmyResult},
|
||||||
utils::validation::is_valid_body_field,
|
utils::validation::is_valid_body_field,
|
||||||
|
|
|
@ -8,8 +8,7 @@ use lemmy_db_schema::source::{
|
||||||
oauth_provider::OAuthProvider,
|
oauth_provider::OAuthProvider,
|
||||||
tagline::Tagline,
|
tagline::Tagline,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
use lemmy_db_views::structs::{LocalUserView, PersonView, SiteView};
|
||||||
use lemmy_db_views_actor::structs::PersonView;
|
|
||||||
use lemmy_utils::{build_cache, error::LemmyResult, CacheLock, VERSION};
|
use lemmy_utils::{build_cache, error::LemmyResult, CacheLock, VERSION};
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,7 @@ use lemmy_db_schema::source::{
|
||||||
instance_block::InstanceBlock,
|
instance_block::InstanceBlock,
|
||||||
person_block::PersonBlock,
|
person_block::PersonBlock,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityFollowerView, CommunityModeratorView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityFollowerView, CommunityModeratorView};
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -21,7 +21,6 @@ workspace = true
|
||||||
lemmy_utils = { workspace = true, features = ["full"] }
|
lemmy_utils = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_schema = { workspace = true, features = ["full"] }
|
lemmy_db_schema = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views = { workspace = true, features = ["full"] }
|
lemmy_db_views = { workspace = true, features = ["full"] }
|
||||||
lemmy_db_views_actor = { workspace = true, features = ["full"] }
|
|
||||||
lemmy_api_common = { workspace = true, features = ["full"] }
|
lemmy_api_common = { workspace = true, features = ["full"] }
|
||||||
activitypub_federation = { workspace = true }
|
activitypub_federation = { workspace = true }
|
||||||
diesel = { workspace = true }
|
diesel = { workspace = true }
|
||||||
|
|
|
@ -29,7 +29,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::{Crud, Reportable},
|
traits::{Crud, Reportable},
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
use lemmy_db_views::structs::CommunityModeratorView;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyResult};
|
use lemmy_utils::error::{LemmyError, LemmyResult};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_db_schema::source::activity::ActivitySendTargets;
|
use lemmy_db_schema::source::activity::ActivitySendTargets;
|
||||||
use lemmy_db_views_actor::structs::PrivateMessageView;
|
use lemmy_db_views::structs::PrivateMessageView;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyResult};
|
use lemmy_utils::error::{LemmyError, LemmyResult};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ use lemmy_db_schema::{
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
CommunityVisibility,
|
CommunityVisibility,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::{CommunityPersonBanView, CommunityView};
|
use lemmy_db_views::structs::{CommunityPersonBanView, CommunityView};
|
||||||
use lemmy_utils::error::{FederationError, LemmyError, LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{FederationError, LemmyError, LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
|
@ -16,7 +16,7 @@ use lemmy_db_schema::{
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
comment_view::CommentQuery,
|
comment::comment_view::CommentQuery,
|
||||||
structs::{CommentView, LocalUserView, SiteView},
|
structs::{CommentView, LocalUserView, SiteView},
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
|
@ -7,7 +7,7 @@ use lemmy_api_common::{
|
||||||
utils::check_private_instance,
|
utils::check_private_instance,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
person_content_combined_view::PersonContentCombinedQuery,
|
combined::person_content_combined_view::PersonContentCombinedQuery,
|
||||||
structs::{LocalUserView, SiteView},
|
structs::{LocalUserView, SiteView},
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
|
@ -15,7 +15,7 @@ use lemmy_db_schema::{
|
||||||
source::{community::Community, post::PostRead},
|
source::{community::Community, post::PostRead},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
post_view::PostQuery,
|
post::post_view::PostQuery,
|
||||||
structs::{LocalUserView, PaginationCursor, SiteView},
|
structs::{LocalUserView, PaginationCursor, SiteView},
|
||||||
};
|
};
|
||||||
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
|
|
|
@ -11,8 +11,7 @@ use lemmy_db_schema::source::{
|
||||||
community::Community,
|
community::Community,
|
||||||
local_site::LocalSite,
|
local_site::LocalSite,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityModeratorView, CommunityView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, CommunityView};
|
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -6,8 +6,7 @@ use lemmy_api_common::{
|
||||||
person::{GetPersonDetails, GetPersonDetailsResponse},
|
person::{GetPersonDetails, GetPersonDetailsResponse},
|
||||||
utils::{check_private_instance, is_admin, read_site_for_actor},
|
utils::{check_private_instance, is_admin, read_site_for_actor},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::{LocalUserView, SiteView};
|
use lemmy_db_views::structs::{CommunityModeratorView, LocalUserView, PersonView, SiteView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityModeratorView, PersonView};
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -11,8 +11,7 @@ use lemmy_api_common::{
|
||||||
utils::check_private_instance,
|
utils::check_private_instance,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::local_site::LocalSite, utils::DbPool};
|
use lemmy_db_schema::{source::local_site::LocalSite, utils::DbPool};
|
||||||
use lemmy_db_views::structs::{CommentView, LocalUserView, PostView};
|
use lemmy_db_views::structs::{CommentView, CommunityView, LocalUserView, PersonView, PostView};
|
||||||
use lemmy_db_views_actor::structs::{CommunityView, PersonView};
|
|
||||||
use lemmy_utils::error::{LemmyErrorExt2, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt2, LemmyErrorType, LemmyResult};
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
|
|
@ -4,19 +4,13 @@ use actix_web::web::{Json, Query};
|
||||||
use lemmy_api_common::{
|
use lemmy_api_common::{
|
||||||
context::LemmyContext,
|
context::LemmyContext,
|
||||||
site::{Search, SearchResponse},
|
site::{Search, SearchResponse},
|
||||||
utils::{check_conflicting_like_filters, check_private_instance, is_admin},
|
utils::{check_conflicting_like_filters, check_private_instance},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{source::community::Community, utils::post_to_comment_sort_type, SearchType};
|
use lemmy_db_schema::source::community::Community;
|
||||||
use lemmy_db_views::{
|
use lemmy_db_views::{
|
||||||
comment_view::CommentQuery,
|
combined::search_combined_view::SearchCombinedQuery,
|
||||||
post_view::PostQuery,
|
|
||||||
structs::{LocalUserView, SiteView},
|
structs::{LocalUserView, SiteView},
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::{
|
|
||||||
community_view::CommunityQuery,
|
|
||||||
person_view::PersonQuery,
|
|
||||||
structs::CommunitySortType,
|
|
||||||
};
|
|
||||||
use lemmy_utils::error::LemmyResult;
|
use lemmy_utils::error::LemmyResult;
|
||||||
|
|
||||||
#[tracing::instrument(skip(context))]
|
#[tracing::instrument(skip(context))]
|
||||||
|
@ -28,154 +22,43 @@ pub async fn search(
|
||||||
let local_site = SiteView::read_local(&mut context.pool()).await?;
|
let local_site = SiteView::read_local(&mut context.pool()).await?;
|
||||||
|
|
||||||
check_private_instance(&local_user_view, &local_site.local_site)?;
|
check_private_instance(&local_user_view, &local_site.local_site)?;
|
||||||
|
check_conflicting_like_filters(data.liked_only, data.disliked_only)?;
|
||||||
|
|
||||||
let is_admin = local_user_view
|
let community_id = if let Some(name) = &data.community_name {
|
||||||
.as_ref()
|
|
||||||
.map(|luv| is_admin(luv).is_ok())
|
|
||||||
.unwrap_or_default();
|
|
||||||
|
|
||||||
let mut posts = Vec::new();
|
|
||||||
let mut comments = Vec::new();
|
|
||||||
let mut communities = Vec::new();
|
|
||||||
let mut users = Vec::new();
|
|
||||||
|
|
||||||
// TODO no clean / non-nsfw searching rn
|
|
||||||
|
|
||||||
let Query(Search {
|
|
||||||
q,
|
|
||||||
community_id,
|
|
||||||
community_name,
|
|
||||||
creator_id,
|
|
||||||
type_,
|
|
||||||
sort,
|
|
||||||
listing_type,
|
|
||||||
page,
|
|
||||||
limit,
|
|
||||||
title_only,
|
|
||||||
post_url_only,
|
|
||||||
liked_only,
|
|
||||||
disliked_only,
|
|
||||||
}) = data;
|
|
||||||
|
|
||||||
let q = q.clone();
|
|
||||||
let search_type = type_.unwrap_or(SearchType::All);
|
|
||||||
let community_id = if let Some(name) = &community_name {
|
|
||||||
Some(
|
Some(
|
||||||
resolve_actor_identifier::<ApubCommunity, Community>(name, &context, &local_user_view, false)
|
resolve_actor_identifier::<ApubCommunity, Community>(name, &context, &local_user_view, false)
|
||||||
.await?,
|
.await?,
|
||||||
)
|
)
|
||||||
.map(|c| c.id)
|
.map(|c| c.id)
|
||||||
} else {
|
} else {
|
||||||
community_id
|
data.community_id
|
||||||
};
|
};
|
||||||
let local_user = local_user_view.as_ref().map(|l| &l.local_user);
|
let search_term = data.search_term.clone();
|
||||||
|
|
||||||
check_conflicting_like_filters(liked_only, disliked_only)?;
|
// parse pagination token
|
||||||
|
let page_after = if let Some(pa) = &data.page_cursor {
|
||||||
|
Some(pa.read(&mut context.pool()).await?)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
let page_back = data.page_back;
|
||||||
|
|
||||||
let posts_query = PostQuery {
|
let results = SearchCombinedQuery {
|
||||||
sort,
|
search_term,
|
||||||
listing_type,
|
|
||||||
community_id,
|
community_id,
|
||||||
creator_id,
|
creator_id: data.creator_id,
|
||||||
local_user,
|
type_: data.type_,
|
||||||
search_term: Some(q.clone()),
|
sort: data.sort,
|
||||||
page,
|
listing_type: data.listing_type,
|
||||||
limit,
|
title_only: data.title_only,
|
||||||
title_only,
|
post_url_only: data.post_url_only,
|
||||||
url_only: post_url_only,
|
liked_only: data.liked_only,
|
||||||
liked_only,
|
disliked_only: data.disliked_only,
|
||||||
disliked_only,
|
page_after,
|
||||||
..Default::default()
|
page_back,
|
||||||
};
|
}
|
||||||
|
.list(&mut context.pool(), &local_user_view)
|
||||||
|
.await?;
|
||||||
|
|
||||||
let comment_query = CommentQuery {
|
Ok(Json(SearchResponse { results }))
|
||||||
sort: sort.map(post_to_comment_sort_type),
|
|
||||||
listing_type,
|
|
||||||
search_term: Some(q.clone()),
|
|
||||||
community_id,
|
|
||||||
creator_id,
|
|
||||||
local_user,
|
|
||||||
page,
|
|
||||||
limit,
|
|
||||||
liked_only,
|
|
||||||
disliked_only,
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
let community_query = CommunityQuery {
|
|
||||||
sort: sort.map(CommunitySortType::from),
|
|
||||||
listing_type,
|
|
||||||
search_term: Some(q.clone()),
|
|
||||||
title_only,
|
|
||||||
local_user,
|
|
||||||
is_mod_or_admin: is_admin,
|
|
||||||
page,
|
|
||||||
limit,
|
|
||||||
..Default::default()
|
|
||||||
};
|
|
||||||
|
|
||||||
let person_query = PersonQuery {
|
|
||||||
sort,
|
|
||||||
search_term: Some(q.clone()),
|
|
||||||
listing_type,
|
|
||||||
page,
|
|
||||||
limit,
|
|
||||||
};
|
|
||||||
|
|
||||||
match search_type {
|
|
||||||
SearchType::Posts => {
|
|
||||||
posts = posts_query
|
|
||||||
.list(&local_site.site, &mut context.pool())
|
|
||||||
.await?;
|
|
||||||
}
|
|
||||||
SearchType::Comments => {
|
|
||||||
comments = comment_query
|
|
||||||
.list(&local_site.site, &mut context.pool())
|
|
||||||
.await?;
|
|
||||||
}
|
|
||||||
SearchType::Communities => {
|
|
||||||
communities = community_query
|
|
||||||
.list(&local_site.site, &mut context.pool())
|
|
||||||
.await?;
|
|
||||||
}
|
|
||||||
SearchType::Users => {
|
|
||||||
users = person_query.list(&mut context.pool()).await?;
|
|
||||||
}
|
|
||||||
SearchType::All => {
|
|
||||||
// If the community or creator is included, dont search communities or users
|
|
||||||
let community_or_creator_included =
|
|
||||||
community_id.is_some() || community_name.is_some() || creator_id.is_some();
|
|
||||||
|
|
||||||
posts = posts_query
|
|
||||||
.list(&local_site.site, &mut context.pool())
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
comments = comment_query
|
|
||||||
.list(&local_site.site, &mut context.pool())
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
communities = if community_or_creator_included {
|
|
||||||
vec![]
|
|
||||||
} else {
|
|
||||||
community_query
|
|
||||||
.list(&local_site.site, &mut context.pool())
|
|
||||||
.await?
|
|
||||||
};
|
|
||||||
|
|
||||||
users = if community_or_creator_included {
|
|
||||||
vec![]
|
|
||||||
} else {
|
|
||||||
person_query.list(&mut context.pool()).await?
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Return the jwt
|
|
||||||
Ok(Json(SearchResponse {
|
|
||||||
type_: search_type,
|
|
||||||
comments,
|
|
||||||
posts,
|
|
||||||
communities,
|
|
||||||
users,
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,8 +323,7 @@ pub(crate) mod tests {
|
||||||
},
|
},
|
||||||
traits::{Crud, Followable},
|
traits::{Crud, Followable},
|
||||||
};
|
};
|
||||||
use lemmy_db_views::structs::LocalUserView;
|
use lemmy_db_views::structs::{CommunityFollowerView, LocalUserView};
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
use serial_test::serial;
|
use serial_test::serial;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
|
@ -10,7 +10,7 @@ use activitypub_federation::{
|
||||||
};
|
};
|
||||||
use lemmy_api_common::{context::LemmyContext, utils::generate_followers_url};
|
use lemmy_api_common::{context::LemmyContext, utils::generate_followers_url};
|
||||||
use lemmy_db_schema::aggregates::structs::CommunityAggregates;
|
use lemmy_db_schema::aggregates::structs::CommunityAggregates;
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
use lemmy_db_views::structs::CommunityFollowerView;
|
||||||
use lemmy_utils::error::LemmyError;
|
use lemmy_utils::error::LemmyError;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use lemmy_db_schema::{
|
||||||
source::community::{CommunityModerator, CommunityModeratorForm},
|
source::community::{CommunityModerator, CommunityModeratorForm},
|
||||||
traits::Joinable,
|
traits::Joinable,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
use lemmy_db_views::structs::CommunityModeratorView;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyResult};
|
use lemmy_utils::error::{LemmyError, LemmyResult};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ use activitypub_federation::{
|
||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use lemmy_api_common::{context::LemmyContext, utils::generate_outbox_url};
|
use lemmy_api_common::{context::LemmyContext, utils::generate_outbox_url};
|
||||||
use lemmy_db_schema::{source::site::Site, utils::FETCH_LIMIT_MAX, PostSortType};
|
use lemmy_db_schema::{source::site::Site, utils::FETCH_LIMIT_MAX, PostSortType};
|
||||||
use lemmy_db_views::post_view::PostQuery;
|
use lemmy_db_views::post::post_view::PostQuery;
|
||||||
use lemmy_utils::error::{LemmyError, LemmyResult};
|
use lemmy_utils::error::{LemmyError, LemmyResult};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ use actix_web::{
|
||||||
};
|
};
|
||||||
use lemmy_api_common::context::LemmyContext;
|
use lemmy_api_common::context::LemmyContext;
|
||||||
use lemmy_db_schema::{source::community::Community, traits::ApubActor, CommunityVisibility};
|
use lemmy_db_schema::{source::community::Community, traits::ApubActor, CommunityVisibility};
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
use lemmy_db_views::structs::CommunityFollowerView;
|
||||||
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorType, LemmyResult};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ use lemmy_db_schema::{
|
||||||
source::{activity::SentActivity, community::Community},
|
source::{activity::SentActivity, community::Community},
|
||||||
CommunityVisibility,
|
CommunityVisibility,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
use lemmy_db_views::structs::CommunityFollowerView;
|
||||||
use lemmy_utils::error::{FederationError, LemmyErrorExt, LemmyErrorType, LemmyResult};
|
use lemmy_utils::error::{FederationError, LemmyErrorExt, LemmyErrorType, LemmyResult};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::{ops::Deref, time::Duration};
|
use std::{ops::Deref, time::Duration};
|
||||||
|
|
|
@ -40,7 +40,7 @@ use lemmy_db_schema::{
|
||||||
traits::{ApubActor, Crud},
|
traits::{ApubActor, Crud},
|
||||||
CommunityVisibility,
|
CommunityVisibility,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::CommunityFollowerView;
|
use lemmy_db_views::structs::CommunityFollowerView;
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyError, LemmyResult},
|
error::{LemmyError, LemmyResult},
|
||||||
spawn_try_task,
|
spawn_try_task,
|
||||||
|
|
|
@ -36,7 +36,7 @@ use lemmy_db_schema::{
|
||||||
},
|
},
|
||||||
traits::Crud,
|
traits::Crud,
|
||||||
};
|
};
|
||||||
use lemmy_db_views_actor::structs::CommunityModeratorView;
|
use lemmy_db_views::structs::CommunityModeratorView;
|
||||||
use lemmy_utils::{
|
use lemmy_utils::{
|
||||||
error::{LemmyError, LemmyResult},
|
error::{LemmyError, LemmyResult},
|
||||||
spawn_try_task,
|
spawn_try_task,
|
||||||
|
|
|
@ -22,7 +22,7 @@ use lemmy_db_schema::{
|
||||||
utils::{build_db_pool, get_conn, now},
|
utils::{build_db_pool, get_conn, now},
|
||||||
PostSortType,
|
PostSortType,
|
||||||
};
|
};
|
||||||
use lemmy_db_views::{post_view::PostQuery, structs::PaginationCursor};
|
use lemmy_db_views::{post::post_view::PostQuery, structs::PaginationCursor};
|
||||||
use lemmy_utils::error::{LemmyErrorExt2, LemmyResult};
|
use lemmy_utils::error::{LemmyErrorExt2, LemmyResult};
|
||||||
use std::num::NonZeroU32;
|
use std::num::NonZeroU32;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
@ -160,7 +160,7 @@ async fn try_main() -> LemmyResult<()> {
|
||||||
.list(&site()?, &mut conn.into())
|
.list(&site()?, &mut conn.into())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some(post_view) = post_views.into_iter().last() {
|
if let Some(post_view) = post_views.into_iter().next_back() {
|
||||||
println!("👀 getting pagination cursor data for next page");
|
println!("👀 getting pagination cursor data for next page");
|
||||||
let cursor_data = PaginationCursor::after_post(&post_view)
|
let cursor_data = PaginationCursor::after_post(&post_view)
|
||||||
.read(&mut conn.into(), None)
|
.read(&mut conn.into(), None)
|
||||||
|
|
|
@ -927,3 +927,126 @@ CREATE TRIGGER require_uplete
|
||||||
FOR EACH STATEMENT
|
FOR EACH STATEMENT
|
||||||
EXECUTE FUNCTION r.require_uplete ();
|
EXECUTE FUNCTION r.require_uplete ();
|
||||||
|
|
||||||
|
-- search: (post, comment, community, person)
|
||||||
|
CREATE PROCEDURE r.create_search_combined_trigger (table_name text)
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $a$
|
||||||
|
BEGIN
|
||||||
|
EXECUTE replace($b$ CREATE FUNCTION r.search_combined_thing_insert ( )
|
||||||
|
RETURNS TRIGGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
-- TODO need to figure out how to do the other columns here
|
||||||
|
INSERT INTO search_combined (published, thing_id)
|
||||||
|
VALUES (NEW.published, NEW.id);
|
||||||
|
RETURN NEW;
|
||||||
|
END $$;
|
||||||
|
CREATE TRIGGER search_combined
|
||||||
|
AFTER INSERT ON thing
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE FUNCTION r.search_combined_thing_insert ( );
|
||||||
|
$b$,
|
||||||
|
'thing',
|
||||||
|
table_name);
|
||||||
|
END;
|
||||||
|
$a$;
|
||||||
|
|
||||||
|
CALL r.create_search_combined_trigger ('post');
|
||||||
|
|
||||||
|
CALL r.create_search_combined_trigger ('comment');
|
||||||
|
|
||||||
|
CALL r.create_search_combined_trigger ('community');
|
||||||
|
|
||||||
|
CALL r.create_search_combined_trigger ('person');
|
||||||
|
|
||||||
|
-- You also need to triggers to update the `score` column.
|
||||||
|
-- post | post_aggregates::score
|
||||||
|
-- comment | comment_aggregates::score
|
||||||
|
-- community | community_aggregates::users_active_monthly
|
||||||
|
-- person | person_aggregates::post_score
|
||||||
|
--
|
||||||
|
-- Post score
|
||||||
|
CREATE FUNCTION r.search_combined_post_score_update ()
|
||||||
|
RETURNS TRIGGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
UPDATE
|
||||||
|
search_combined
|
||||||
|
SET
|
||||||
|
score = NEW.score
|
||||||
|
WHERE
|
||||||
|
post_id = NEW.post_id;
|
||||||
|
RETURN NULL;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
|
CREATE TRIGGER search_combined_post_score
|
||||||
|
AFTER UPDATE OF score ON post_aggregates
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE FUNCTION r.search_combined_post_score_update ();
|
||||||
|
|
||||||
|
-- Comment score
|
||||||
|
CREATE FUNCTION r.search_combined_comment_score_update ()
|
||||||
|
RETURNS TRIGGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
UPDATE
|
||||||
|
search_combined
|
||||||
|
SET
|
||||||
|
score = NEW.score
|
||||||
|
WHERE
|
||||||
|
comment_id = NEW.comment_id;
|
||||||
|
RETURN NULL;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
|
CREATE TRIGGER search_combined_comment_score
|
||||||
|
AFTER UPDATE OF score ON comment_aggregates
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE FUNCTION r.search_combined_comment_score_update ();
|
||||||
|
|
||||||
|
-- Person score
|
||||||
|
CREATE FUNCTION r.search_combined_person_score_update ()
|
||||||
|
RETURNS TRIGGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
UPDATE
|
||||||
|
search_combined
|
||||||
|
SET
|
||||||
|
score = NEW.post_score
|
||||||
|
WHERE
|
||||||
|
person_id = NEW.person_id;
|
||||||
|
RETURN NULL;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
|
CREATE TRIGGER search_combined_person_score
|
||||||
|
AFTER UPDATE OF post_score ON person_aggregates
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE FUNCTION r.search_combined_person_score_update ();
|
||||||
|
|
||||||
|
-- Community score
|
||||||
|
CREATE FUNCTION r.search_combined_community_score_update ()
|
||||||
|
RETURNS TRIGGER
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
UPDATE
|
||||||
|
search_combined
|
||||||
|
SET
|
||||||
|
score = NEW.users_active_month
|
||||||
|
WHERE
|
||||||
|
community_id = NEW.community_id;
|
||||||
|
RETURN NULL;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
|
CREATE TRIGGER search_combined_community_score
|
||||||
|
AFTER UPDATE OF users_active_month ON community_aggregates
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE FUNCTION r.search_combined_community_score_update ();
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ impl LocalImage {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn delete_by_url(pool: &mut DbPool<'_>, url: &DbUrl) -> Result<Self, Error> {
|
pub async fn delete_by_url(pool: &mut DbPool<'_>, url: &DbUrl) -> Result<Self, Error> {
|
||||||
let alias = url.as_str().split('/').last().ok_or(NotFound)?;
|
let alias = url.as_str().split('/').next_back().ok_or(NotFound)?;
|
||||||
Self::delete_by_alias(pool, alias).await
|
Self::delete_by_alias(pool, alias).await
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,19 @@ pub enum CommentSortType {
|
||||||
Controversial,
|
Controversial,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(
|
||||||
|
EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Default, Hash,
|
||||||
|
)]
|
||||||
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
|
/// The search sort types.
|
||||||
|
pub enum SearchSortType {
|
||||||
|
#[default]
|
||||||
|
New,
|
||||||
|
Top,
|
||||||
|
Old,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Default, Hash,
|
EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Default, Hash,
|
||||||
)]
|
)]
|
||||||
|
@ -166,11 +179,14 @@ pub enum PostListingMode {
|
||||||
SmallCard,
|
SmallCard,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(
|
||||||
|
EnumString, Display, Debug, Serialize, Deserialize, Default, Clone, Copy, PartialEq, Eq, Hash,
|
||||||
|
)]
|
||||||
#[cfg_attr(feature = "full", derive(TS))]
|
#[cfg_attr(feature = "full", derive(TS))]
|
||||||
#[cfg_attr(feature = "full", ts(export))]
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
/// The type of content returned from a search.
|
/// The type of content returned from a search.
|
||||||
pub enum SearchType {
|
pub enum SearchType {
|
||||||
|
#[default]
|
||||||
All,
|
All,
|
||||||
Comments,
|
Comments,
|
||||||
Posts,
|
Posts,
|
||||||
|
|
|
@ -220,6 +220,11 @@ pub struct ModlogCombinedId(i32);
|
||||||
/// The inbox combined id
|
/// The inbox combined id
|
||||||
pub struct InboxCombinedId(i32);
|
pub struct InboxCombinedId(i32);
|
||||||
|
|
||||||
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Serialize, Deserialize, Default)]
|
||||||
|
#[cfg_attr(feature = "full", derive(DieselNewType))]
|
||||||
|
/// The search combined id
|
||||||
|
pub struct SearchCombinedId(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, TS))]
|
#[cfg_attr(feature = "full", derive(DieselNewType, TS))]
|
||||||
#[cfg_attr(feature = "full", ts(export))]
|
#[cfg_attr(feature = "full", ts(export))]
|
||||||
|
|
|
@ -995,6 +995,18 @@ diesel::table! {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diesel::table! {
|
||||||
|
search_combined (id) {
|
||||||
|
id -> Int4,
|
||||||
|
published -> Timestamptz,
|
||||||
|
score -> Int8,
|
||||||
|
post_id -> Nullable<Int4>,
|
||||||
|
comment_id -> Nullable<Int4>,
|
||||||
|
community_id -> Nullable<Int4>,
|
||||||
|
person_id -> Nullable<Int4>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diesel::table! {
|
diesel::table! {
|
||||||
secret (id) {
|
secret (id) {
|
||||||
id -> Int4,
|
id -> Int4,
|
||||||
|
@ -1196,6 +1208,10 @@ diesel::joinable!(report_combined -> comment_report (comment_report_id));
|
||||||
diesel::joinable!(report_combined -> community_report (community_report_id));
|
diesel::joinable!(report_combined -> community_report (community_report_id));
|
||||||
diesel::joinable!(report_combined -> post_report (post_report_id));
|
diesel::joinable!(report_combined -> post_report (post_report_id));
|
||||||
diesel::joinable!(report_combined -> private_message_report (private_message_report_id));
|
diesel::joinable!(report_combined -> private_message_report (private_message_report_id));
|
||||||
|
diesel::joinable!(search_combined -> comment (comment_id));
|
||||||
|
diesel::joinable!(search_combined -> community (community_id));
|
||||||
|
diesel::joinable!(search_combined -> person (person_id));
|
||||||
|
diesel::joinable!(search_combined -> post (post_id));
|
||||||
diesel::joinable!(site -> instance (instance_id));
|
diesel::joinable!(site -> instance (instance_id));
|
||||||
diesel::joinable!(site_aggregates -> site (site_id));
|
diesel::joinable!(site_aggregates -> site (site_id));
|
||||||
diesel::joinable!(site_language -> language (language_id));
|
diesel::joinable!(site_language -> language (language_id));
|
||||||
|
@ -1274,6 +1290,7 @@ diesel::allow_tables_to_appear_in_same_query!(
|
||||||
registration_application,
|
registration_application,
|
||||||
remote_image,
|
remote_image,
|
||||||
report_combined,
|
report_combined,
|
||||||
|
search_combined,
|
||||||
secret,
|
secret,
|
||||||
sent_activity,
|
sent_activity,
|
||||||
site,
|
site,
|
||||||
|
|
|
@ -3,3 +3,4 @@ pub mod modlog;
|
||||||
pub mod person_content;
|
pub mod person_content;
|
||||||
pub mod person_saved;
|
pub mod person_saved;
|
||||||
pub mod report;
|
pub mod report;
|
||||||
|
pub mod search;
|
||||||
|
|
28
crates/db_schema/src/source/combined/search.rs
Normal file
28
crates/db_schema/src/source/combined/search.rs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
use crate::newtypes::{CommentId, CommunityId, PersonId, PostId, SearchCombinedId};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use crate::schema::search_combined;
|
||||||
|
use chrono::{DateTime, Utc};
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
use i_love_jesus::CursorKeysModule;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_with::skip_serializing_none;
|
||||||
|
|
||||||
|
#[skip_serializing_none]
|
||||||
|
#[derive(PartialEq, Eq, Serialize, Deserialize, Debug, Clone)]
|
||||||
|
#[cfg_attr(
|
||||||
|
feature = "full",
|
||||||
|
derive(Identifiable, Queryable, Selectable, CursorKeysModule)
|
||||||
|
)]
|
||||||
|
#[cfg_attr(feature = "full", diesel(table_name = search_combined))]
|
||||||
|
#[cfg_attr(feature = "full", diesel(check_for_backend(diesel::pg::Pg)))]
|
||||||
|
#[cfg_attr(feature = "full", cursor_keys_module(name = search_combined_keys))]
|
||||||
|
/// A combined table for a search (posts, comments, communities, persons)
|
||||||
|
pub struct SearchCombined {
|
||||||
|
pub id: SearchCombinedId,
|
||||||
|
pub published: DateTime<Utc>,
|
||||||
|
pub score: i64,
|
||||||
|
pub post_id: Option<PostId>,
|
||||||
|
pub comment_id: Option<CommentId>,
|
||||||
|
pub community_id: Option<CommunityId>,
|
||||||
|
pub person_id: Option<PersonId>,
|
||||||
|
}
|
|
@ -42,6 +42,7 @@ actix-web = { workspace = true, optional = true }
|
||||||
i-love-jesus = { workspace = true, optional = true }
|
i-love-jesus = { workspace = true, optional = true }
|
||||||
chrono = { workspace = true }
|
chrono = { workspace = true }
|
||||||
derive-new.workspace = true
|
derive-new.workspace = true
|
||||||
|
strum = { workspace = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serial_test = { workspace = true }
|
serial_test = { workspace = true }
|
||||||
|
|
|
@ -40,7 +40,9 @@ use lemmy_db_schema::{
|
||||||
post,
|
post,
|
||||||
post_actions,
|
post_actions,
|
||||||
post_aggregates,
|
post_aggregates,
|
||||||
|
post_tag,
|
||||||
private_message,
|
private_message,
|
||||||
|
tag,
|
||||||
},
|
},
|
||||||
source::{
|
source::{
|
||||||
combined::inbox::{inbox_combined_keys as key, InboxCombined},
|
combined::inbox::{inbox_combined_keys as key, InboxCombined},
|
||||||
|
@ -244,6 +246,15 @@ impl InboxCombinedQuery {
|
||||||
|
|
||||||
let community_join = post::community_id.eq(community::id);
|
let community_join = post::community_id.eq(community::id);
|
||||||
|
|
||||||
|
let post_tags = post_tag::table
|
||||||
|
.inner_join(tag::table)
|
||||||
|
.select(diesel::dsl::sql::<diesel::sql_types::Json>(
|
||||||
|
"json_agg(tag.*)",
|
||||||
|
))
|
||||||
|
.filter(post_tag::post_id.eq(post::id))
|
||||||
|
.filter(tag::deleted.eq(false))
|
||||||
|
.single_value();
|
||||||
|
|
||||||
let mut query = inbox_combined::table
|
let mut query = inbox_combined::table
|
||||||
.left_join(comment_reply::table)
|
.left_join(comment_reply::table)
|
||||||
.left_join(person_comment_mention::table)
|
.left_join(person_comment_mention::table)
|
||||||
|
@ -308,6 +319,7 @@ impl InboxCombinedQuery {
|
||||||
post_actions::hidden.nullable().is_not_null(),
|
post_actions::hidden.nullable().is_not_null(),
|
||||||
post_actions::like_score.nullable(),
|
post_actions::like_score.nullable(),
|
||||||
image_details::all_columns.nullable(),
|
image_details::all_columns.nullable(),
|
||||||
|
post_tags,
|
||||||
private_message::all_columns.nullable(),
|
private_message::all_columns.nullable(),
|
||||||
// Shared
|
// Shared
|
||||||
post::all_columns.nullable(),
|
post::all_columns.nullable(),
|
||||||
|
@ -520,6 +532,7 @@ impl InternalToCombinedView for InboxCombinedViewInternal {
|
||||||
hidden: v.post_hidden,
|
hidden: v.post_hidden,
|
||||||
my_vote: v.my_post_vote,
|
my_vote: v.my_post_vote,
|
||||||
image_details: v.image_details,
|
image_details: v.image_details,
|
||||||
|
post_tags: v.post_tags,
|
||||||
banned_from_community: v.banned_from_community,
|
banned_from_community: v.banned_from_community,
|
||||||
}))
|
}))
|
||||||
} else if let Some(private_message) = v.private_message {
|
} else if let Some(private_message) = v.private_message {
|
||||||
|
@ -538,7 +551,7 @@ impl InternalToCombinedView for InboxCombinedViewInternal {
|
||||||
#[expect(clippy::indexing_slicing)]
|
#[expect(clippy::indexing_slicing)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
inbox_combined_view::InboxCombinedQuery,
|
combined::inbox_combined_view::InboxCombinedQuery,
|
||||||
structs::{InboxCombinedView, InboxCombinedViewInternal, PrivateMessageView},
|
structs::{InboxCombinedView, InboxCombinedViewInternal, PrivateMessageView},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
12
crates/db_views/src/combined/mod.rs
Normal file
12
crates/db_views/src/combined/mod.rs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod inbox_combined_view;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod modlog_combined_view;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod person_content_combined_view;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod person_saved_combined_view;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod report_combined_view;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod search_combined_view;
|
|
@ -592,7 +592,7 @@ impl InternalToCombinedView for ModlogCombinedViewInternal {
|
||||||
#[expect(clippy::indexing_slicing)]
|
#[expect(clippy::indexing_slicing)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use crate::{modlog_combined_view::ModlogCombinedQuery, structs::ModlogCombinedView};
|
use crate::{combined::modlog_combined_view::ModlogCombinedQuery, structs::ModlogCombinedView};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
||||||
newtypes::PersonId,
|
newtypes::PersonId,
|
||||||
source::{
|
source::{
|
|
@ -3,7 +3,7 @@ use crate::structs::{
|
||||||
LocalUserView,
|
LocalUserView,
|
||||||
PersonContentCombinedPaginationCursor,
|
PersonContentCombinedPaginationCursor,
|
||||||
PersonContentCombinedView,
|
PersonContentCombinedView,
|
||||||
PersonContentViewInternal,
|
PersonContentCombinedViewInternal,
|
||||||
PostView,
|
PostView,
|
||||||
};
|
};
|
||||||
use diesel::{
|
use diesel::{
|
||||||
|
@ -235,7 +235,9 @@ impl PersonContentCombinedQuery {
|
||||||
// Tie breaker
|
// Tie breaker
|
||||||
.then_desc(key::id);
|
.then_desc(key::id);
|
||||||
|
|
||||||
let res = query.load::<PersonContentViewInternal>(conn).await?;
|
let res = query
|
||||||
|
.load::<PersonContentCombinedViewInternal>(conn)
|
||||||
|
.await?;
|
||||||
|
|
||||||
// Map the query results to the enum
|
// Map the query results to the enum
|
||||||
let out = res
|
let out = res
|
||||||
|
@ -247,7 +249,7 @@ impl PersonContentCombinedQuery {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl InternalToCombinedView for PersonContentViewInternal {
|
impl InternalToCombinedView for PersonContentCombinedViewInternal {
|
||||||
type CombinedView = PersonContentCombinedView;
|
type CombinedView = PersonContentCombinedView;
|
||||||
|
|
||||||
fn map_to_enum(self) -> Option<Self::CombinedView> {
|
fn map_to_enum(self) -> Option<Self::CombinedView> {
|
||||||
|
@ -299,7 +301,7 @@ impl InternalToCombinedView for PersonContentViewInternal {
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
person_content_combined_view::PersonContentCombinedQuery,
|
combined::person_content_combined_view::PersonContentCombinedQuery,
|
||||||
structs::PersonContentCombinedView,
|
structs::PersonContentCombinedView,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::structs::{
|
use crate::structs::{
|
||||||
LocalUserView,
|
LocalUserView,
|
||||||
PersonContentCombinedView,
|
PersonContentCombinedView,
|
||||||
PersonContentViewInternal,
|
PersonContentCombinedViewInternal,
|
||||||
PersonSavedCombinedPaginationCursor,
|
PersonSavedCombinedPaginationCursor,
|
||||||
};
|
};
|
||||||
use diesel::{
|
use diesel::{
|
||||||
|
@ -236,7 +236,9 @@ impl PersonSavedCombinedQuery {
|
||||||
// Tie breaker
|
// Tie breaker
|
||||||
.then_desc(key::id);
|
.then_desc(key::id);
|
||||||
|
|
||||||
let res = query.load::<PersonContentViewInternal>(conn).await?;
|
let res = query
|
||||||
|
.load::<PersonContentCombinedViewInternal>(conn)
|
||||||
|
.await?;
|
||||||
|
|
||||||
// Map the query results to the enum
|
// Map the query results to the enum
|
||||||
let out = res
|
let out = res
|
||||||
|
@ -253,7 +255,7 @@ impl PersonSavedCombinedQuery {
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
person_saved_combined_view::PersonSavedCombinedQuery,
|
combined::person_saved_combined_view::PersonSavedCombinedQuery,
|
||||||
structs::{LocalUserView, PersonContentCombinedView},
|
structs::{LocalUserView, PersonContentCombinedView},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
|
@ -491,7 +491,7 @@ impl InternalToCombinedView for ReportCombinedViewInternal {
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
report_combined_view::ReportCombinedQuery,
|
combined::report_combined_view::ReportCombinedQuery,
|
||||||
structs::{
|
structs::{
|
||||||
CommentReportView,
|
CommentReportView,
|
||||||
LocalUserView,
|
LocalUserView,
|
1194
crates/db_views/src/combined/search_combined_view.rs
Normal file
1194
crates/db_views/src/combined/search_combined_view.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -374,7 +374,7 @@ fn handle_deleted(mut c: CommentView, is_admin: bool) -> CommentView {
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
comment_view::{CommentQuery, CommentSortType, CommentView, DbPool},
|
comment::comment_view::{CommentQuery, CommentSortType, CommentView, DbPool},
|
||||||
structs::LocalUserView,
|
structs::LocalUserView,
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
2
crates/db_views/src/comment/mod.rs
Normal file
2
crates/db_views/src/comment/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod comment_view;
|
|
@ -266,7 +266,7 @@ impl CommunityQuery<'_> {
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
community_view::CommunityQuery,
|
community::community_view::CommunityQuery,
|
||||||
structs::{CommunitySortType, CommunityView},
|
structs::{CommunitySortType, CommunityView},
|
||||||
};
|
};
|
||||||
use lemmy_db_schema::{
|
use lemmy_db_schema::{
|
|
@ -6,10 +6,3 @@ pub mod community_moderator_view;
|
||||||
pub mod community_person_ban_view;
|
pub mod community_person_ban_view;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod community_view;
|
pub mod community_view;
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod inbox_combined_view;
|
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod person_view;
|
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod private_message_view;
|
|
||||||
pub mod structs;
|
|
|
@ -2,33 +2,23 @@
|
||||||
extern crate serial_test;
|
extern crate serial_test;
|
||||||
|
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod comment_report_view;
|
pub mod combined;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod comment_view;
|
pub mod comment;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod custom_emoji_view;
|
pub mod community;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod local_image_view;
|
pub mod local_user;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod local_user_view;
|
pub mod person;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod person_content_combined_view;
|
pub mod post;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod person_saved_combined_view;
|
pub mod private_message;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod post_report_view;
|
pub mod registration_applications;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod post_tags_view;
|
pub mod reports;
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
pub mod post_view;
|
pub mod site;
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod private_message_report_view;
|
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod registration_application_view;
|
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod report_combined_view;
|
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod site_view;
|
|
||||||
pub mod structs;
|
pub mod structs;
|
||||||
#[cfg(feature = "full")]
|
|
||||||
pub mod vote_view;
|
|
||||||
|
|
2
crates/db_views/src/local_user/mod.rs
Normal file
2
crates/db_views/src/local_user/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod local_user_view;
|
2
crates/db_views/src/person/mod.rs
Normal file
2
crates/db_views/src/person/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod person_view;
|
4
crates/db_views/src/post/mod.rs
Normal file
4
crates/db_views/src/post/mod.rs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod post_tags_view;
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod post_view;
|
|
@ -638,7 +638,7 @@ impl<'a> PostQuery<'a> {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
post_view::{PaginationCursorData, PostQuery, PostView},
|
post::post_view::{PaginationCursorData, PostQuery, PostView},
|
||||||
structs::{LocalUserView, PostTags},
|
structs::{LocalUserView, PostTags},
|
||||||
};
|
};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
@ -1604,7 +1604,7 @@ mod tests {
|
||||||
|
|
||||||
listed_post_ids.extend(post_listings.iter().map(|p| p.post.id));
|
listed_post_ids.extend(post_listings.iter().map(|p| p.post.id));
|
||||||
|
|
||||||
if let Some(p) = post_listings.into_iter().last() {
|
if let Some(p) = post_listings.into_iter().next_back() {
|
||||||
page_after = Some(p.counts);
|
page_after = Some(p.counts);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
2
crates/db_views/src/private_message/mod.rs
Normal file
2
crates/db_views/src/private_message/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
pub mod private_message_view;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue