24 lines
717 B
Hy
24 lines
717 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
|
|
(.order_by
|
|
(.where (select models.OutboxObject)
|
|
(.in_ models.OutboxObject.visibility [VisibilityEnum.PUBLIC VisibilityEnum.UNLISTED])
|
|
(.is_ models.OutboxObject.is_deleted False))
|
|
(.desc models.OutboxObject.created_at))))))
|