mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 11:34:18 +00:00
publish: 1.0.0
This commit is contained in:
parent
cfb9f2017b
commit
e6db8d248a
5 changed files with 56 additions and 4 deletions
2
publish.bat
Normal file
2
publish.bat
Normal file
|
@ -0,0 +1,2 @@
|
|||
git commit -am "publish: %1"
|
||||
git push && poetry build && poetry publish && hub release create "%1" -m "Wikipack %1"
|
|
@ -3,7 +3,7 @@
|
|||
[tool.poetry]
|
||||
name = "wikipack"
|
||||
description = "A Wiki for Royalnet"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0"
|
||||
authors = ["Stefano Pigozzi <ste.pigozzi@gmail.com>"]
|
||||
license = "AGPL-3.0+"
|
||||
homepage = "https://github.com/Steffo99/wikipack/"
|
||||
|
@ -20,7 +20,7 @@
|
|||
python = "^3.8"
|
||||
|
||||
[tool.poetry.dependencies.royalnet]
|
||||
version = "~5.8.16"
|
||||
version = "~5.9.0"
|
||||
extras = [
|
||||
"alchemy_easy",
|
||||
"constellation",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
# Imports go here!
|
||||
from .api_wiki import ApiWikiStar
|
||||
from .api_wiki_list import ApiWikiListStar
|
||||
|
||||
# Enter the PageStars of your Pack here!
|
||||
available_page_stars = [
|
||||
ApiWikiStar
|
||||
ApiWikiStar,
|
||||
ApiWikiListStar,
|
||||
]
|
||||
|
||||
# Don't change this, it should automatically generate __all__
|
||||
|
|
48
wikipack/stars/api_wiki_list.py
Normal file
48
wikipack/stars/api_wiki_list.py
Normal file
|
@ -0,0 +1,48 @@
|
|||
from typing import *
|
||||
import datetime
|
||||
import royalnet.constellation.api as rca
|
||||
import royalnet.utils as ru
|
||||
import royalnet.backpack.tables as rbt
|
||||
from ..tables import *
|
||||
import sqlalchemy as s
|
||||
|
||||
|
||||
class ApiWikiListStar(rca.ApiStar):
|
||||
path = "/api/wiki/list/v2"
|
||||
|
||||
tags = ["wiki"]
|
||||
|
||||
methods = ["GET"]
|
||||
|
||||
parameters = {
|
||||
"get": {},
|
||||
}
|
||||
|
||||
auth = {
|
||||
"get": False,
|
||||
}
|
||||
|
||||
async def get(self, data: rca.ApiData) -> ru.JSON:
|
||||
"""Get the details of a specific Wiki page."""
|
||||
WikiRevisionT = self.alchemy.get(WikiRevision)
|
||||
|
||||
lrs = await ru.asyncify(
|
||||
data.session
|
||||
.query(WikiRevisionT.page_id, s.func.max(WikiRevisionT.revision_id))
|
||||
.group_by(WikiRevisionT.page_id)
|
||||
.all
|
||||
)
|
||||
|
||||
pages = []
|
||||
|
||||
for page_id, revision_id in lrs:
|
||||
page = await ru.asyncify(
|
||||
data.session
|
||||
.query(WikiRevisionT)
|
||||
.get,
|
||||
(page_id, revision_id)
|
||||
)
|
||||
|
||||
pages.append(page)
|
||||
|
||||
return [r.json_list() for r in pages]
|
|
@ -1 +1 @@
|
|||
semantic = "0.1.0"
|
||||
semantic = "1.0.0"
|
||||
|
|
Loading…
Reference in a new issue