xn-auth 0.2.32__py3-none-any.whl → 0.2.34.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
x_auth/models.py CHANGED
@@ -4,6 +4,7 @@ from aiogram.types import User as TgUser
4
4
  from aiogram.utils.web_app import WebAppUser
5
5
  from aiohttp import ClientSession
6
6
  from msgspec import convert
7
+ from pyrogram.enums.client_platform import ClientPlatform
7
8
  from tortoise.fields import (
8
9
  BigIntField,
9
10
  BooleanField,
@@ -21,6 +22,8 @@ from tortoise.fields import (
21
22
  ForeignKeyNullableRelation,
22
23
  JSONField,
23
24
  )
25
+ from tortoise.fields.data import CharEnumFieldInstance
26
+
24
27
  from x_auth import types
25
28
  from x_model.field import DatetimeSecField
26
29
  from x_model.models import Model, TsTrait
@@ -68,8 +71,8 @@ class User(Model):
68
71
  async def is_blocked(cls, sid: str) -> bool:
69
72
  return (await cls[int(sid)]).blocked
70
73
 
71
- class Meta:
72
- abstract = True
74
+ # class Meta:
75
+ # abstract = True
73
76
 
74
77
 
75
78
  class Country(Model):
@@ -151,6 +154,7 @@ class Dc(TortModel):
151
154
  pub = CharField(495, null=True)
152
155
 
153
156
  apps: BackwardFKRelation["App"]
157
+ sessions: BackwardFKRelation["App"]
154
158
 
155
159
 
156
160
  class Fcm(TortModel):
@@ -169,7 +173,8 @@ class App(Model):
169
173
  ver = CharField(18, default="0.0.1")
170
174
  fcm: ForeignKeyNullableRelation[Fcm] = ForeignKeyField("models.Fcm", "apps", null=True)
171
175
  fcm_id: int
172
- # owner: OneToOneRelation["User"] = OneToOneField("models.User", "app")
176
+ platform: ClientPlatform = CharEnumFieldInstance(ClientPlatform)
177
+ owner: OneToOneRelation["User"] = OneToOneField("models.User", "app")
173
178
 
174
179
  sessions: BackwardFKRelation["Session"]
175
180
 
@@ -178,6 +183,8 @@ class Session(TortModel):
178
183
  id = CharField(85, primary_key=True)
179
184
  api: ForeignKeyRelation[App] = ForeignKeyField("models.App", "sessions")
180
185
  api_id: int
186
+ dc: ForeignKeyRelation[Dc] = ForeignKeyField("models.Dc", "sessions", default=2)
187
+ dc_id: int
181
188
  test_mode = BooleanField(default=False)
182
189
  auth_key = BinaryField(null=True)
183
190
  date = IntField(default=0) # todo: refact to datetime?
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xn-auth
3
- Version: 0.2.32
3
+ Version: 0.2.34.dev1
4
4
  Summary: Auth adapter for XN-Api framework
5
5
  Author-email: Artemiev <mixartemev@gmail.com>
6
6
  License: MIT
@@ -0,0 +1,10 @@
1
+ x_auth/controller.py,sha256=0QhqmqXOqFaWIUTWHlJKITQNmJQ5kXZOkLg7wSUTh60,2240
2
+ x_auth/enums.py,sha256=kmkX-j1bWNpel6_-fw2YtMEmJSAj9w2iizkG03s3ZSU,631
3
+ x_auth/exceptions.py,sha256=2B4okJxhPyNqTJXlSTfblJUQJ60bLGXdgJIu6ue7S6w,162
4
+ x_auth/middleware.py,sha256=JfssQomDv0J_69GfS2a_2_uyRzs26zSY6IW1Vk7m8K0,2900
5
+ x_auth/models.py,sha256=BW3pUn3iAULuoCvYXbdKJfpHWmSGHQzfV663RUs9lrE,7937
6
+ x_auth/types.py,sha256=j3WGcyH24DmFEdTT6U7xzb_fEm1tFcBZsANKMy7bydo,689
7
+ xn_auth-0.2.34.dev1.dist-info/METADATA,sha256=sCKAlmPf7GNqyknSzJfrWinFBADvttccSlG1cmQz9ZA,804
8
+ xn_auth-0.2.34.dev1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
9
+ xn_auth-0.2.34.dev1.dist-info/top_level.txt,sha256=ydMDkzxgQPtW-E_MNDfUAroAFZvWSqU-x_kZSA7NSFo,7
10
+ xn_auth-0.2.34.dev1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- x_auth/controller.py,sha256=0QhqmqXOqFaWIUTWHlJKITQNmJQ5kXZOkLg7wSUTh60,2240
2
- x_auth/enums.py,sha256=kmkX-j1bWNpel6_-fw2YtMEmJSAj9w2iizkG03s3ZSU,631
3
- x_auth/exceptions.py,sha256=2B4okJxhPyNqTJXlSTfblJUQJ60bLGXdgJIu6ue7S6w,162
4
- x_auth/middleware.py,sha256=JfssQomDv0J_69GfS2a_2_uyRzs26zSY6IW1Vk7m8K0,2900
5
- x_auth/models.py,sha256=SGuQLfT_kF5VdC7qSxD_cfWOszBFTJv6H2upyaCDqVw,7612
6
- x_auth/types.py,sha256=j3WGcyH24DmFEdTT6U7xzb_fEm1tFcBZsANKMy7bydo,689
7
- xn_auth-0.2.32.dist-info/METADATA,sha256=4VUEifZVmx4ZVKXm9cCKTZEYMErTeKHgtpwMlS3gp60,799
8
- xn_auth-0.2.32.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
9
- xn_auth-0.2.32.dist-info/top_level.txt,sha256=ydMDkzxgQPtW-E_MNDfUAroAFZvWSqU-x_kZSA7NSFo,7
10
- xn_auth-0.2.32.dist-info/RECORD,,