[2ff88f42] refactor(connector-superoffice): finalize production readiness cleanup
- Integrated centralized logging system in all modules. - Extracted all IDs and ProgIds into a separate . - Refactored and for cleaner dependency management. - Included updated discovery and inspection utilities. - Verified end-to-end workflow stability.
This commit is contained in:
45
connector-superoffice/config.py
Normal file
45
connector-superoffice/config.py
Normal file
@@ -0,0 +1,45 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Load environment variables
|
||||
if os.path.exists(".env"):
|
||||
load_dotenv(".env", override=True)
|
||||
elif os.path.exists("../.env"):
|
||||
load_dotenv("../.env", override=True)
|
||||
|
||||
class Config:
|
||||
# SuperOffice API Configuration
|
||||
SO_CLIENT_ID = os.getenv("SO_SOD")
|
||||
SO_CLIENT_SECRET = os.getenv("SO_CLIENT_SECRET")
|
||||
SO_CONTEXT_IDENTIFIER = os.getenv("SO_CONTEXT_IDENTIFIER")
|
||||
SO_REFRESH_TOKEN = os.getenv("SO_REFRESH_TOKEN")
|
||||
|
||||
# Company Explorer Configuration
|
||||
CE_API_URL = os.getenv("CE_API_URL", "http://company-explorer:8000")
|
||||
CE_API_USER = os.getenv("CE_API_USER", "admin")
|
||||
CE_API_PASSWORD = os.getenv("CE_API_PASSWORD", "gemini")
|
||||
|
||||
# UDF Mapping (ProgIds) - Defaulting to SOD values, should be overridden in Prod
|
||||
UDF_CONTACT_MAPPING = {
|
||||
"ai_challenge_sentence": os.getenv("UDF_CONTACT_CHALLENGE", "SuperOffice:1"),
|
||||
"ai_sentence_timestamp": os.getenv("UDF_CONTACT_TIMESTAMP", "SuperOffice:2"),
|
||||
"ai_sentence_source_hash": os.getenv("UDF_CONTACT_HASH", "SuperOffice:3"),
|
||||
"ai_last_outreach_date": os.getenv("UDF_CONTACT_OUTREACH", "SuperOffice:4")
|
||||
}
|
||||
|
||||
UDF_PERSON_MAPPING = {
|
||||
"ai_email_draft": os.getenv("UDF_PERSON_DRAFT", "SuperOffice:1"),
|
||||
"ma_status": os.getenv("UDF_PERSON_STATUS", "SuperOffice:2")
|
||||
}
|
||||
|
||||
# MA Status ID Mapping (Text -> ID) - Defaulting to discovered SOD values
|
||||
MA_STATUS_ID_MAP = {
|
||||
"Ready_to_Send": int(os.getenv("MA_STATUS_ID_READY", 11)),
|
||||
"Sent_Week1": int(os.getenv("MA_STATUS_ID_WEEK1", 12)),
|
||||
"Sent_Week2": int(os.getenv("MA_STATUS_ID_WEEK2", 13)),
|
||||
"Bounced": int(os.getenv("MA_STATUS_ID_BOUNCED", 14)),
|
||||
"Soft_Denied": int(os.getenv("MA_STATUS_ID_DENIED", 15)),
|
||||
"Interested": int(os.getenv("MA_STATUS_ID_INTERESTED", 16)),
|
||||
"Out_of_Office": int(os.getenv("MA_STATUS_ID_OOO", 17)),
|
||||
"Unsubscribed": int(os.getenv("MA_STATUS_ID_UNSUB", 18))
|
||||
}
|
||||
Reference in New Issue
Block a user