cuenca-validations 2.1.1.dev8__py3-none-any.whl → 2.1.2.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.
@@ -2,14 +2,25 @@ import json
2
2
  from dataclasses import dataclass
3
3
  from typing import Annotated, Any, Optional
4
4
 
5
- from pydantic import AnyUrl, Field, HttpUrl, PlainSerializer, StringConstraints
5
+ from pydantic import (
6
+ AnyUrl,
7
+ Field,
8
+ HttpUrl,
9
+ IPvAnyAddress,
10
+ PlainSerializer,
11
+ StringConstraints,
12
+ )
6
13
 
7
14
  from ..validators import sanitize_dict, sanitize_item
8
15
  from .enums import State
9
16
 
17
+ # We use custom serializers for IP addresses and URLs because
18
+ # Pydantic's IPvAnyAddress, AnyUrl, HttpUrl types are not JSON serializable.
10
19
  SerializableHttpUrl = Annotated[HttpUrl, PlainSerializer(str, return_type=str)]
11
-
12
20
  SerializableAnyUrl = Annotated[AnyUrl, PlainSerializer(str, return_type=str)]
21
+ SerializableIPvAnyAddress = Annotated[
22
+ IPvAnyAddress, PlainSerializer(str, return_type=str)
23
+ ]
13
24
 
14
25
 
15
26
  class SantizedDict(dict):
@@ -5,7 +5,6 @@ from pydantic import (
5
5
  BaseModel,
6
6
  ConfigDict,
7
7
  Field,
8
- IPvAnyAddress,
9
8
  SecretStr,
10
9
  StringConstraints,
11
10
  model_validator,
@@ -13,6 +12,7 @@ from pydantic import (
13
12
  from pydantic_extra_types.phone_numbers import PhoneNumber
14
13
 
15
14
  from .enums import Country, KYCFileType, State, VerificationStatus
15
+ from .general import SerializableIPvAnyAddress
16
16
 
17
17
  Password = Annotated[
18
18
  SecretStr,
@@ -165,7 +165,7 @@ class KYCFile(BaseModel):
165
165
 
166
166
  class TOSAgreement(BaseModel):
167
167
  version: str
168
- ip: IPvAnyAddress
168
+ ip: SerializableIPvAnyAddress
169
169
  location: Optional[str] = None
170
170
  model_config = ConfigDict(
171
171
  json_schema_extra={
@@ -12,7 +12,6 @@ from pydantic import (
12
12
  field_validator,
13
13
  model_validator,
14
14
  )
15
- from pydantic.networks import IPvAnyAddress
16
15
 
17
16
  from ..types.enums import (
18
17
  AuthorizerTransaction,
@@ -58,6 +57,7 @@ from .general import (
58
57
  LogConfig,
59
58
  SerializableAnyUrl,
60
59
  SerializableHttpUrl,
60
+ SerializableIPvAnyAddress,
61
61
  StrictPositiveInt,
62
62
  )
63
63
  from .identities import (
@@ -398,7 +398,7 @@ class TOSRequest(BaseModel):
398
398
  type: TermsOfService
399
399
  version: str
400
400
  location: Optional[str] = None
401
- ip: Optional[IPvAnyAddress] = None
401
+ ip: Optional[SerializableIPvAnyAddress] = None
402
402
 
403
403
 
404
404
  class UserRequest(BaseModel):
@@ -1 +1 @@
1
- __version__ = '2.1.1.dev8'
1
+ __version__ = '2.1.2.dev1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cuenca_validations
3
- Version: 2.1.1.dev8
3
+ Version: 2.1.2.dev1
4
4
  Summary: Cuenca common validations
5
5
  Home-page: https://github.com/cuenca-mx/cuenca-validations
6
6
  Author: Cuenca
@@ -4,25 +4,25 @@ cuenca_validations/errors.py,sha256=OtM8EgiKqYdz9Hn66AbBO96orL1or7efkyt0vh0Zxbs,
4
4
  cuenca_validations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cuenca_validations/typing.py,sha256=1QCu81IbVZZpyInjyeAuO-nF36gpT5Gi4o6V9PozuOU,204
6
6
  cuenca_validations/validators.py,sha256=wzwLnJ4wHggZvqp3mearbFkzvDERGeTNvJkuofQnuMc,1484
7
- cuenca_validations/version.py,sha256=W7spgn6STPvQSTzwXk1yC-JDLYUy-XWnbNDEsufwq0Y,27
7
+ cuenca_validations/version.py,sha256=jYCSC0KeXBFDD5uNaDFuT7DDXNyNSE3tg3IkrMgbF_s,27
8
8
  cuenca_validations/types/__init__.py,sha256=8fiuz26oYQT2DriQ7sbD740yFJergVhB1OYoUGETB5A,4783
9
9
  cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
10
10
  cuenca_validations/types/enums.py,sha256=sK9ayp8wuu4D5-hjkFTV_-h9xdeVHFj_cZkGjLAzPGI,18853
11
11
  cuenca_validations/types/files.py,sha256=2CszbwF9ytXV9suFFwyDjYG4XxY8UhCjRw3HttVXXNw,269
12
- cuenca_validations/types/general.py,sha256=c3j5Iv42yEpIGbylZ-64uoURgNiTmaZPiV5WOht0jTI,2249
12
+ cuenca_validations/types/general.py,sha256=I1sFlVL61_-Z9n0SQC7ziL9SDEAEgZP4aq_Sem99NOw,2529
13
13
  cuenca_validations/types/helpers.py,sha256=6rHUhwoQ7jJZtGcW3LX-W5ZDl42PWE1RoBpGme7KCkk,610
14
- cuenca_validations/types/identities.py,sha256=5_8WyU7KvhGW8Bv6scofKBDXaBaHm7bToLeF3O4cfL0,4916
14
+ cuenca_validations/types/identities.py,sha256=-TWRDRpmIaCI4nE4hVy1FQtQtlxuErtmEtzJW1FBzec,4956
15
15
  cuenca_validations/types/morals.py,sha256=m8kAedevmwfSPTA9GYe03l7pkgipynwYgKfejyVtnuI,1813
16
16
  cuenca_validations/types/queries.py,sha256=KCRx0sPzWDtDDbZysmFGVgANgfqil17EITWaG7tGQ-A,4700
17
- cuenca_validations/types/requests.py,sha256=Km36QWeqjbQgaKOhIf0tJbDDRQ_uu6h-1MfbMgOB9q0,20556
17
+ cuenca_validations/types/requests.py,sha256=1GpBV-b0IrxuUAkgC_xyBop9CuzXdt9hvTKm1iH36ts,20555
18
18
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  tests/test_card.py,sha256=QAfRz7e11gWICPnFJZ2tiYgUsFV3C9TwzJXrDnDNXFw,1202
20
20
  tests/test_errors.py,sha256=ixiIgEuBuzfsL5p4uCFdF32XqFRtTPF6EVhGJ0keOrI,930
21
21
  tests/test_helpers.py,sha256=ubzpi1UXCryLQdgsT_Zm2IX-XE_4L0dnHnhLwH06xK8,748
22
22
  tests/test_statement.py,sha256=IOE0rRRBgBZSJv_FLaETEyn5NzzXKMNTqgjv99GX-68,1436
23
- tests/test_types.py,sha256=XpFDDO1N6kRARFLr8cXyY7jDRICAwrhNYkFst7cCKQE,17737
24
- cuenca_validations-2.1.1.dev8.dist-info/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
25
- cuenca_validations-2.1.1.dev8.dist-info/METADATA,sha256=fFp2ooMsOdQmAWMDcqdt2mVws8TIcdSwXQIFHzEPlvk,1577
26
- cuenca_validations-2.1.1.dev8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
27
- cuenca_validations-2.1.1.dev8.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
28
- cuenca_validations-2.1.1.dev8.dist-info/RECORD,,
23
+ tests/test_types.py,sha256=SroPI5wo5pV4TN27MEnKArUnyHItFpXm2q2nQoarpuI,17761
24
+ cuenca_validations-2.1.2.dev1.dist-info/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
25
+ cuenca_validations-2.1.2.dev1.dist-info/METADATA,sha256=6wv_MNe7G61mAfBUj4gXopqmEDMpVL75iXyATppZ_sc,1577
26
+ cuenca_validations-2.1.2.dev1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
27
+ cuenca_validations-2.1.2.dev1.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
28
+ cuenca_validations-2.1.2.dev1.dist-info/RECORD,,
tests/test_types.py CHANGED
@@ -348,6 +348,7 @@ def test_user_request():
348
348
  email_verification_id='VE0987654321',
349
349
  required_level=3,
350
350
  terms_of_service=None,
351
+ signature=None,
351
352
  )
352
353
  assert UserRequest(**request).model_dump() == request
353
354