xn-auth 0.2.33__tar.gz → 0.2.34.dev1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xn-auth
3
- Version: 0.2.33
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
@@ -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
@@ -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,6 +173,7 @@ 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
176
+ platform: ClientPlatform = CharEnumFieldInstance(ClientPlatform)
172
177
  owner: OneToOneRelation["User"] = OneToOneField("models.User", "app")
173
178
 
174
179
  sessions: BackwardFKRelation["Session"]
@@ -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.33
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes