Skip to content

Commit 3d544d3

Browse files
authored
fix(jx3api): adapte to the latest version
1 parent 86d17f6 commit 3d544d3

File tree

4 files changed

+49
-49
lines changed

4 files changed

+49
-49
lines changed

.github/workflows/pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- uses: actions/checkout@master
1010
- uses: actions/setup-python@master
1111
with:
12-
python-version: 3.12
12+
python-version: 3.x
1313
- run: |
1414
python -m pip install build --user
1515
python -m build --sdist --wheel --outdir dist

jx3api/jx3api.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,20 @@ def role_achievement(self, *, server, role, name):
179179

180180
@require_token
181181
@require_ticket
182-
def match_recent(self, *, server, name, mode=None):
182+
def arena_recent(self, *, server, name, mode=None):
183183
return self.request(
184-
endpoint="/data/match/recent", server=server, name=name, mode=mode
184+
endpoint="/data/arena/recent", server=server, name=name, mode=mode
185185
)
186186

187187
@require_token
188188
@require_ticket
189-
def match_awesome(self, *, mode=33, limit=20):
190-
return self.request(endpoint="/data/match/awesome", mode=mode, limit=limit)
189+
def arena_awesome(self, *, mode=33, limit=20):
190+
return self.request(endpoint="/data/arena/awesome", mode=mode, limit=limit)
191191

192192
@require_token
193193
@require_ticket
194-
def match_schools(self, *, mode=33):
195-
return self.request(endpoint="/data/match/schools", mode=mode)
194+
def arena_schools(self, *, mode=33):
195+
return self.request(endpoint="/data/arena/schools", mode=mode)
196196

197197
@require_token
198198
def member_recruit(self, *, server, keyword=None, table=1):
@@ -566,22 +566,22 @@ async def role_achievement(self, *, server, role, name):
566566

567567
@require_token
568568
@require_ticket
569-
async def match_recent(self, *, server, name, mode=None):
569+
async def arena_recent(self, *, server, name, mode=None):
570570
return await self.request(
571-
endpoint="/data/match/recent", server=server, name=name, mode=mode
571+
endpoint="/data/arena/recent", server=server, name=name, mode=mode
572572
)
573573

574574
@require_token
575575
@require_ticket
576-
async def match_awesome(self, *, mode=33, limit=20):
576+
async def arena_awesome(self, *, mode=33, limit=20):
577577
return await self.request(
578-
endpoint="/data/match/awesome", mode=mode, limit=limit
578+
endpoint="/data/arena/awesome", mode=mode, limit=limit
579579
)
580580

581581
@require_token
582582
@require_ticket
583-
async def match_schools(self, *, mode=33):
584-
return await self.request(endpoint="/data/match/schools", mode=mode)
583+
async def arena_schools(self, *, mode=33):
584+
return await self.request(endpoint="/data/arena/schools", mode=mode)
585585

586586
@require_token
587587
async def member_recruit(self, *, server, keyword=None, table=1):

jx3api/jx3api.pyi

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ class RoleAchievement(TypedDict):
358358
personAvatar: Annotated[str, "人物头像"]
359359
data: Annotated[Sequence[_RoleAchievement], "成就数据"]
360360

361-
class MatchRecentPerformance3v3(TypedDict):
361+
class ArenaRecentPerformance3v3(TypedDict):
362362
mmr: Annotated[int, "3v3 竞技场 MMR"]
363363
grade: Annotated[int, "3v3 竞技场 段位"]
364364
ranking: Annotated[str, "3v3 竞技场 排名"]
@@ -368,7 +368,7 @@ class MatchRecentPerformance3v3(TypedDict):
368368
pvpType: Annotated[str, "3v3 竞技场 类型"]
369369
winRate: Annotated[int, "3v3 竞技场 胜率"]
370370

371-
class MatchRecentHistory(TypedDict):
371+
class ArenaRecentHistory(TypedDict):
372372
zone: Annotated[str, "区服"]
373373
server: Annotated[str, "服务器"]
374374
avgGrade: Annotated[int, "平均段位"]
@@ -381,15 +381,15 @@ class MatchRecentHistory(TypedDict):
381381
startTime: Annotated[int, "开始时间"]
382382
endTime: Annotated[int, "结束时间"]
383383

384-
class MatchRecentTrend(TypedDict):
384+
class ArenaRecentTrend(TypedDict):
385385
matchDate: Annotated[int, "比赛日期"]
386386
mmr: Annotated[int, "MMR"]
387387
winRate: Annotated[float, "胜率"]
388388

389-
class MatchRecentPerformance(TypedDict, total=False):
390-
_3v3: MatchRecentPerformance3v3
389+
class ArenaRecentPerformance(TypedDict, total=False):
390+
_3v3: ArenaRecentPerformance3v3
391391

392-
class MatchRecent(TypedDict):
392+
class ArenaRecent(TypedDict):
393393
zoneName: Annotated[str, "区服名称"]
394394
serverName: Annotated[str, "服务器名称"]
395395
roleName: Annotated[str, "角色名称"]
@@ -406,11 +406,11 @@ class MatchRecent(TypedDict):
406406
personName: Annotated[str, "人物名称"]
407407
personId: Annotated[str, "人物 ID"]
408408
personAvatar: Annotated[str, "人物头像"]
409-
performance: MatchRecentPerformance
410-
history: Annotated[Sequence[MatchRecentHistory], "近期比赛记录"]
411-
trend: Annotated[Sequence[MatchRecentTrend], "近期比赛趋势"]
409+
performance: ArenaRecentPerformance
410+
history: Annotated[Sequence[ArenaRecentHistory], "近期比赛记录"]
411+
trend: Annotated[Sequence[ArenaRecentTrend], "近期比赛趋势"]
412412

413-
class MatchAwesome(TypedDict):
413+
class ArenaAwesome(TypedDict):
414414
zoneName: Annotated[str, "区服名称"]
415415
serverName: Annotated[str, "服务器名称"]
416416
roleName: Annotated[str, "角色名称"]
@@ -421,7 +421,7 @@ class MatchAwesome(TypedDict):
421421
upNum: Annotated[str, "上升名次"]
422422
winRate: Annotated[str, "胜率"]
423423

424-
class MatchSchools(TypedDict):
424+
class ArenaSchools(TypedDict):
425425
name: Annotated[str, "门派名称"]
426426
this: Annotated[int, "本周胜场"]
427427
last: Annotated[int, "上周胜场"]
@@ -1313,15 +1313,15 @@ class JX3API:
13131313
"""
13141314
pass
13151315

1316-
def match_recent(
1316+
def arena_recent(
13171317
self,
13181318
*,
13191319
server: Annotated[str, "区服,查找该区服的相关记录"],
13201320
name: Annotated[str, "角色名称,查找该角色的相关记录"],
13211321
mode: Annotated[int | None, "比赛模式,查找该模式的相关记录"] = None,
1322-
) -> Annotated[MatchRecent, "角色近期战绩记录"]:
1322+
) -> Annotated[ArenaRecent, "角色近期战绩记录"]:
13231323
"""
1324-
match_recent 名剑战绩
1324+
arena_recent 名剑战绩
13251325
13261326
角色近期战绩记录
13271327
@@ -1331,18 +1331,18 @@ class JX3API:
13311331
mode (int, optional): 比赛模式,查找该模式的相关记录。
13321332
13331333
Returns:
1334-
MatchRecent: 角色近期战绩记录。
1334+
ArenaRecent: 角色近期战绩记录。
13351335
"""
13361336
pass
13371337

1338-
def match_awesome(
1338+
def arena_awesome(
13391339
self,
13401340
*,
13411341
mode: Annotated[int, "比赛模式,查找该模式的相关记录,默认值 : 33"] = 33,
13421342
limit: Annotated[int, "限制查询结果的数量,默认值 20"] = 20,
1343-
) -> Annotated[Sequence[MatchAwesome], "角色近期战绩记录"]:
1343+
) -> Annotated[Sequence[ArenaAwesome], "角色近期战绩记录"]:
13441344
"""
1345-
match_awesome 名剑排行
1345+
arena_awesome 名剑排行
13461346
13471347
角色近期战绩记录。
13481348
@@ -1351,25 +1351,25 @@ class JX3API:
13511351
limit (int, optional): 限制查询结果的数量,默认值 20。
13521352
13531353
Returns:
1354-
Sequence[MatchAwesome]: 角色近期战绩记录。
1354+
Sequence[ArenaAwesome]: 角色近期战绩记录。
13551355
"""
13561356
pass
13571357

1358-
def match_schools(
1358+
def arena_schools(
13591359
self,
13601360
*,
13611361
mode: Annotated[int, "比赛模式,查找该模式的相关记录,默认值 : 33"] = 33,
1362-
) -> Annotated[Sequence[MatchSchools], "角色近期战绩记录"]:
1362+
) -> Annotated[Sequence[ArenaSchools], "角色近期战绩记录"]:
13631363
"""
1364-
match_schools 名剑统计
1364+
arena_schools 名剑统计
13651365
13661366
角色近期战绩记录
13671367
13681368
Args:
13691369
mode (int, optional): 比赛模式,查找该模式的相关记录,默认值 : 33。
13701370
13711371
Returns:
1372-
Sequence[MatchSchools]: 角色近期战绩记录.
1372+
Sequence[ArenaSchools]: 角色近期战绩记录.
13731373
"""
13741374
pass
13751375

@@ -2565,15 +2565,15 @@ class AsyncJX3API:
25652565
"""
25662566
pass
25672567

2568-
async def match_recent(
2568+
async def arena_recent(
25692569
self,
25702570
*,
25712571
server: Annotated[str, "区服,查找该区服的相关记录"],
25722572
name: Annotated[str, "角色名称,查找该角色的相关记录"],
25732573
mode: Annotated[int | None, "比赛模式,查找该模式的相关记录"] = None,
2574-
) -> Annotated[Awaitable[MatchRecent], "角色近期战绩记录"]:
2574+
) -> Annotated[Awaitable[ArenaRecent], "角色近期战绩记录"]:
25752575
"""
2576-
match_recent 名剑战绩
2576+
arena_recent 名剑战绩
25772577
25782578
角色近期战绩记录
25792579
@@ -2583,18 +2583,18 @@ class AsyncJX3API:
25832583
mode (int, optional): 比赛模式,查找该模式的相关记录。
25842584
25852585
Returns:
2586-
Awaitable[MatchRecent]: 角色近期战绩记录。
2586+
Awaitable[ArenaRecent]: 角色近期战绩记录。
25872587
"""
25882588
pass
25892589

2590-
async def match_awesome(
2590+
async def arena_awesome(
25912591
self,
25922592
*,
25932593
mode: Annotated[int, "比赛模式,查找该模式的相关记录,默认值 : 33"] = 33,
25942594
limit: Annotated[int, "限制查询结果的数量,默认值 20"] = 20,
2595-
) -> Annotated[Awaitable[Sequence[MatchAwesome]], "角色近期战绩记录"]:
2595+
) -> Annotated[Awaitable[Sequence[ArenaAwesome]], "角色近期战绩记录"]:
25962596
"""
2597-
match_awesome 名剑排行
2597+
arena_awesome 名剑排行
25982598
25992599
角色近期战绩记录。
26002600
@@ -2603,25 +2603,25 @@ class AsyncJX3API:
26032603
limit (int, optional): 限制查询结果的数量,默认值 20。
26042604
26052605
Returns:
2606-
Awaitable[Sequence[MatchAwesome]]: 角色近期战绩记录。
2606+
Awaitable[Sequence[ArenaAwesome]]: 角色近期战绩记录。
26072607
"""
26082608
pass
26092609

2610-
async def match_schools(
2610+
async def arena_schools(
26112611
self,
26122612
*,
26132613
mode: Annotated[int, "比赛模式,查找该模式的相关记录,默认值 : 33"] = 33,
2614-
) -> Annotated[Awaitable[Sequence[MatchSchools]], "角色近期战绩记录"]:
2614+
) -> Annotated[Awaitable[Sequence[ArenaSchools]], "角色近期战绩记录"]:
26152615
"""
2616-
match_schools 名剑统计
2616+
arena_schools 名剑统计
26172617
26182618
角色近期战绩记录
26192619
26202620
Args:
26212621
mode (int, optional): 比赛模式,查找该模式的相关记录,默认值 : 33。
26222622
26232623
Returns:
2624-
Awaitable[Sequence[MatchSchools]]: 角色近期战绩记录.
2624+
Awaitable[Sequence[ArenaSchools]]: 角色近期战绩记录.
26252625
"""
26262626
pass
26272627

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "jx3api"
7-
version = "2024.12.10"
7+
version = "2024.12.15"
88
dependencies = ["aiohttp"]
99
requires-python = ">=3"
1010
description = "The Python SDK to the JX3API"

0 commit comments

Comments
 (0)