22 lines
640 B
Hy
22 lines
640 B
Hy
#!/usr/bin/env hy
|
|
(import app [models])
|
|
(import app.database [async_session])
|
|
(import sqlalchemy [select])
|
|
(import app.activitypub [VisibilityEnum])
|
|
(import pprint [pprint])
|
|
|
|
|
|
(defn/a selete_object
|
|
[db ap_type]
|
|
(.all (await (.scalars db
|
|
(.where (select models.InboxObject)
|
|
(= models.InboxObject.ap_type ap_type))))))
|
|
|
|
|
|
(defn/a get_index_status
|
|
[db]
|
|
(.all (await
|
|
(.scalars db
|
|
(.where (select models.OutboxObject)
|
|
(.in_ models.OutboxObject.visibility [VisibilityEnum.PUBLIC VisibilityEnum.UNLISTED])
|
|
(.is_ models.OutboxObject.is_deleted False))))))
|