(20250625) - Implemented the ecommerce shopify auth integration.
with multiple files added new API for get token details
This commit is contained in:
@@ -42,7 +42,7 @@ from typing import Optional, Literal, Union
|
||||
# Other data models:
|
||||
from models.software.tcaoff_ai.auth import TheCAOfficeAIAuth
|
||||
from models.software.mikrotik.auth import MikroTikPPPoE1000Auth, MikroTikHotspot1000Auth
|
||||
|
||||
from models.software.ecommerce.auth import ShopifyAuth
|
||||
# My utils:
|
||||
from utils_v2.string import regex
|
||||
from utils_v2.date_time import date_time
|
||||
@@ -105,8 +105,8 @@ class SoftwareAuthRequestHeaders(BaseModel):
|
||||
|
||||
class SoftwareAuthRequestData(BaseModel):
|
||||
|
||||
softwareClient: Literal["theCaOfficeAi", "mikrotikPPPoE1000", "mikrotikHotspot1000"] = Field(alias = "client")
|
||||
auth: Union[TheCAOfficeAIAuth, MikroTikPPPoE1000Auth, MikroTikHotspot1000Auth]
|
||||
softwareClient: Literal["theCaOfficeAi", "mikrotikPPPoE1000", "mikrotikHotspot1000", "shopify"] = Field(alias = "client")
|
||||
auth: Union[TheCAOfficeAIAuth, MikroTikPPPoE1000Auth, MikroTikHotspot1000Auth, ShopifyAuth]
|
||||
|
||||
# ┏┓ ┏•
|
||||
# ┃ ┏┓┏┓╋┓┏┓
|
||||
@@ -127,7 +127,8 @@ class SoftwareAuthRequestData(BaseModel):
|
||||
harmony_map = {
|
||||
"theCaOfficeAi": TheCAOfficeAIAuth,
|
||||
"mikrotikPPPoE1000": MikroTikPPPoE1000Auth,
|
||||
"mikrotikHotspot1000": MikroTikHotspot1000Auth
|
||||
"mikrotikHotspot1000": MikroTikHotspot1000Auth,
|
||||
"shopify": ShopifyAuth
|
||||
}
|
||||
if not isinstance(auth, harmony_map[client]):
|
||||
raise ValueError(f"incorrect 'auth' for selected client '{client}'")
|
||||
|
||||
Reference in New Issue
Block a user