(20250117) Day-end push.

This commit is contained in:
2025-01-17 18:57:46 +05:30
parent 8ab63d036d
commit 4b2cdbee76
7 changed files with 356 additions and 331 deletions
+9 -9
View File
@@ -58,7 +58,7 @@ from models.message.mail.sync import MailSyncOneResult, MailSyncManyResults
from models.message.mail.send import MailSendOneResult
# Mail Client(s):
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGMailClient
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGmailClient
# To work with datatypes:
from typing import List, Any
@@ -138,9 +138,9 @@ class AllMailController(MailController):
"""
# Prepare the combined base filter:
sms_filter = {}
for k, v in (base_filter or {}).items(): sms_filter[k] = v
sms_filter["serviceType"] = "sms"
mail_filter = {}
for k, v in (base_filter or {}).items(): mail_filter[k] = v
mail_filter["serviceType"] = "email"
# Invoke the parent's constructor:
MailController.__init__(
@@ -148,7 +148,7 @@ class AllMailController(MailController):
cache = cache,
alert_url = alert_url,
http_client = http_client,
base_filter = sms_filter,
base_filter = mail_filter,
debug = debug,
debug_prefix = debug_prefix,
debug_only_errors = debug_only_errors
@@ -169,7 +169,7 @@ class AllMailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
user_info: CoreUserInfoModel,
inbound_data: OAuthMailAuthorizationRequestData,
session_token: str
@@ -193,7 +193,7 @@ class AllMailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
request_url: str,
inbound_data: dict,
session_token: str = None
@@ -216,7 +216,7 @@ class AllMailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
http_client: httpx.AsyncClient,
auth_token: CoreAuthTokenModel,
force_refresh: bool = False,
@@ -257,7 +257,7 @@ class AllMailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
auth_token: CoreAuthTokenModel,
user_info: CoreUserInfoModel | None,
llm: CoreLLMController = None,
+6 -6
View File
@@ -58,7 +58,7 @@ from models.message.mail.sync import MailSyncOneResult, MailSyncManyResults
from models.message.mail.send import MailSendOneResult
# Mail Client(s):
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGMailClient
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGmailClient
# To work with datatypes:
from typing import List, Any
@@ -190,7 +190,7 @@ class MailController(CoreMessageController, ABC):
for k, v in (base_filter or {}).items(): sms_filter[k] = v
sms_filter["serviceType"] = "email"
# Invoke the parent's constructor:
# Invoke the parents' constructor:
CoreMessageController.__init__(
self,
cache = cache,
@@ -300,7 +300,7 @@ class MailController(CoreMessageController, ABC):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
user_info: CoreUserInfoModel,
inbound_data: OAuthMailAuthorizationRequestData,
session_token: str
@@ -325,7 +325,7 @@ class MailController(CoreMessageController, ABC):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
request_url: str,
inbound_data: dict,
session_token: str = None
@@ -349,7 +349,7 @@ class MailController(CoreMessageController, ABC):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
http_client: httpx.AsyncClient,
auth_token: CoreAuthTokenModel,
force_refresh: bool = False,
@@ -426,7 +426,7 @@ class MailController(CoreMessageController, ABC):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
auth_token: CoreAuthTokenModel,
user_info: CoreUserInfoModel | None,
llm: CoreLLMController = None,
+7 -6
View File
@@ -57,7 +57,7 @@ from models.message.mail.sync import MailSyncOneResult, MailSyncManyResults
from models.message.mail.send import MailSendOneResult
# Mail Client(s):
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGMailClient, SCOPES_GMAIL_MAIL_MANAGEMENT
from utils_v2.goog.controllers.gmail.gmail_client import AsyncGmailClient, SCOPES_GMAIL_MAIL_MANAGEMENT
from utils_v2.goog.models.auth_tokens import GoogleAuthTokens
# To work with datatypes:
@@ -163,7 +163,7 @@ class GmailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
user_info: CoreUserInfoModel,
inbound_data: OAuthMailAuthorizationRequestData,
session_token: str
@@ -230,7 +230,7 @@ class GmailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
request_url: str,
inbound_data: dict,
session_token: str = None
@@ -368,7 +368,7 @@ class GmailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
http_client: httpx.AsyncClient,
auth_token: CoreAuthTokenModel,
force_refresh: bool = False,
@@ -451,7 +451,7 @@ class GmailController(MailController):
mongo_data_conn: AsyncMongo,
user_info: CoreUserInfoModel,
auth_token: CoreAuthTokenModel,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
google_tokens: GoogleAuthTokens,
message_id: str,
llm: CoreLLMController = None,
@@ -495,6 +495,7 @@ class GmailController(MailController):
f"Gmail message '{message_id}' already "
f"sync'd on {mail_records[0].syncTs} (UTC)."
)
print(sync_result)
return sync_result
# Now that we know that we have to fetch the mail from GMail:
@@ -561,7 +562,7 @@ class GmailController(MailController):
self,
sql_conn: AsyncMySQL,
mongo_data_conn: AsyncMongo,
mail_client: AsyncGMailClient,
mail_client: AsyncGmailClient,
auth_token: CoreAuthTokenModel,
user_info: CoreUserInfoModel | None,
llm: CoreLLMController = None,