cs-models 0.0.818__py3-none-any.whl → 0.0.820__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.

Potentially problematic release.


This version of cs-models might be problematic. Click here for more details.

File without changes
@@ -0,0 +1,35 @@
1
+ from datetime import datetime
2
+ from sqlalchemy import (
3
+ Column,
4
+ Integer,
5
+ String,
6
+ DateTime,
7
+ UniqueConstraint,
8
+ Text,
9
+ )
10
+
11
+ from ...database import Base
12
+
13
+
14
+ class MindgramOAuthTokenModel(Base):
15
+ __tablename__ = "mindgram_oauth_tokens"
16
+ __table_args__ = (UniqueConstraint("user_id", "provider", name="ux_user_provider"),)
17
+
18
+ id = Column(Integer, primary_key=True, autoincrement=True)
19
+ user_id = Column(String(128), nullable=False)
20
+ provider = Column(String(32), nullable=False)
21
+ access_token = Column(Text, nullable=True)
22
+ refresh_token = Column(Text, nullable=False)
23
+ token_type = Column(String(32), nullable=True, default="Bearer")
24
+ scope = Column(Text, nullable=True)
25
+ expiry = Column(DateTime, nullable=True)
26
+ token_uri = Column(String(255), nullable=False)
27
+ client_id = Column(String(255), nullable=False)
28
+ client_secret = Column(String(255), nullable=False)
29
+ updated_at = Column(
30
+ DateTime,
31
+ nullable=False,
32
+ # https://stackoverflow.com/questions/58776476/why-doesnt-freezegun-work-with-sqlalchemy-default-values
33
+ default=lambda: datetime.utcnow(),
34
+ onupdate=lambda: datetime.utcnow(),
35
+ )
@@ -0,0 +1,20 @@
1
+ from marshmallow import (
2
+ Schema,
3
+ fields,
4
+ )
5
+
6
+
7
+ class MindgramOAuthTokenResourceSchema(Schema):
8
+ id = fields.Integer(dump_only=True)
9
+ user_id = fields.String(required=True)
10
+ provider = fields.String(required=True)
11
+ access_token = fields.String(allow_none=True)
12
+ refresh_token = fields.String(required=True)
13
+ token_type = fields.String(allow_none=True)
14
+ scope = fields.String(allow_none=True)
15
+ expiry = fields.DateTime(allow_none=True)
16
+ token_uri = fields.String(required=True)
17
+ client_id = fields.String(required=True)
18
+ client_secret = fields.String(required=True)
19
+ created_at = fields.DateTime(dump_only=True)
20
+ updated_at = fields.DateTime(dump_only=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cs-models
3
- Version: 0.0.818
3
+ Version: 0.0.820
4
4
  Summary: MySQL db models
5
5
  Home-page: https://github.com/mindgram/cs-models
6
6
  Author: Shrey Verma
@@ -596,6 +596,9 @@ cs_models/resources/MergerOutboxCompany/schemas.py,sha256=PpXAGPuk_tHR9ydmFEPr4e
596
596
  cs_models/resources/MergerSentences/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
597
597
  cs_models/resources/MergerSentences/models.py,sha256=I3q9pP9Nakzs9nqqgqDt-6HMql-pRHeTZ2JpK5pfvvA,818
598
598
  cs_models/resources/MergerSentences/schemas.py,sha256=WmTpRQY42wTwG2Flk-LFJ7uukqYEcYyCj6hv-49Jmwk,455
599
+ cs_models/resources/MindgramOAuth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
600
+ cs_models/resources/MindgramOAuth/models.py,sha256=l20Ldju8kYGMevDySXABNhMDotwu7qaCkVo_uHYCGgA,1188
601
+ cs_models/resources/MindgramOAuth/schemas.py,sha256=UCU-d1GGQFie0uRWlMKFElyC5qSJcg5x9LXAB2Htzpo,702
599
602
  cs_models/resources/Modality/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
600
603
  cs_models/resources/Modality/models.py,sha256=aYM_svz7MwYQizydXMvzn_fPjy8lTFi5ExbgfJK4z5s,447
601
604
  cs_models/resources/Modality/schemas.py,sha256=WdDFJ6C26XGN1eu9LdkbGBzlEDUSlvuyo0sPXdfOg_Q,296
@@ -1321,7 +1324,7 @@ cs_models/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1321
1324
  cs_models/utils/alchemy.py,sha256=fhINGFn41owJ2DLXQKXAAtLqeZ1BRzD_qU0wPK_bsGQ,1598
1322
1325
  cs_models/utils/utils.py,sha256=BzCDk3u1np7DoJQqCZIJN4f80JNHvJoWO4qEFgolN-8,4474
1323
1326
  cs_models/utils/profiling/__init__.py,sha256=N-73vb0M92C975fxgXyBCBjCPELl8Oh21ZY_-tzDnns,569
1324
- cs_models-0.0.818.dist-info/METADATA,sha256=frbNHSW6uwtRQ9FRKBDAlPJxRLNmwIDn8aIPdk-VPR8,751
1325
- cs_models-0.0.818.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1326
- cs_models-0.0.818.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
1327
- cs_models-0.0.818.dist-info/RECORD,,
1327
+ cs_models-0.0.820.dist-info/METADATA,sha256=gPKah--rDJSS_BaU3Hh16xd8Xvc07K8WS4PfQw1Lc2c,751
1328
+ cs_models-0.0.820.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
1329
+ cs_models-0.0.820.dist-info/top_level.txt,sha256=M7CA8Nh5t0vRManQ9gHfphhO16uhMqIbfaxr1jPDg18,10
1330
+ cs_models-0.0.820.dist-info/RECORD,,