Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2fe807b7f9 |
@@ -3,6 +3,7 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"webhookUrl": "Webhook URL",
|
"webhookUrl": "Webhook URL",
|
||||||
"apiKey": "API Key",
|
"apiKey": "API Key",
|
||||||
|
"espocrmApiKey": "EspoCRM API Key",
|
||||||
"maxMessagesPerHour": "Max Messages Per Hour",
|
"maxMessagesPerHour": "Max Messages Per Hour",
|
||||||
"inactivityWarningDays": "Inactivity Warning Days",
|
"inactivityWarningDays": "Inactivity Warning Days",
|
||||||
"inactivityCriticalDays": "Inactivity Critical Days",
|
"inactivityCriticalDays": "Inactivity Critical Days",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"webhookUrl": "כתובת Webhook",
|
"webhookUrl": "כתובת Webhook",
|
||||||
"apiKey": "מפתח API",
|
"apiKey": "מפתח API",
|
||||||
|
"espocrmApiKey": "מפתח API של EspoCRM",
|
||||||
"maxMessagesPerHour": "מקסימום הודעות לשעה",
|
"maxMessagesPerHour": "מקסימום הודעות לשעה",
|
||||||
"inactivityWarningDays": "ימים לאזהרת חוסר פעילות",
|
"inactivityWarningDays": "ימים לאזהרת חוסר פעילות",
|
||||||
"inactivityCriticalDays": "ימים לאזהרה קריטית",
|
"inactivityCriticalDays": "ימים לאזהרה קריטית",
|
||||||
|
|||||||
+4
@@ -8,6 +8,10 @@
|
|||||||
"type": "varchar",
|
"type": "varchar",
|
||||||
"maxLength": 255
|
"maxLength": 255
|
||||||
},
|
},
|
||||||
|
"espocrmApiKey": {
|
||||||
|
"type": "varchar",
|
||||||
|
"maxLength": 255
|
||||||
|
},
|
||||||
"maxMessagesPerHour": {
|
"maxMessagesPerHour": {
|
||||||
"type": "int",
|
"type": "int",
|
||||||
"default": 30
|
"default": 30
|
||||||
|
|||||||
@@ -374,12 +374,18 @@ class SmartAssistantService
|
|||||||
throw new Error('SmartAssistant webhook URL is not configured. Go to Admin > Integrations > Smart Assistant.');
|
throw new Error('SmartAssistant webhook URL is not configured. Go to Admin > Integrations > Smart Assistant.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$siteUrl = $this->config->get('siteUrl') ?? '';
|
||||||
|
|
||||||
$payload = json_encode([
|
$payload = json_encode([
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
'context' => $context,
|
'context' => $context,
|
||||||
'conversationId' => $conversationId,
|
'conversationId' => $conversationId,
|
||||||
'conversationHistory' => $history,
|
'conversationHistory' => $history,
|
||||||
'mode' => $mode,
|
'mode' => $mode,
|
||||||
|
'espocrm' => [
|
||||||
|
'url' => rtrim($siteUrl, '/'),
|
||||||
|
'apiKey' => $this->getEspocrmApiKey(),
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$headers = ['Content-Type: application/json', 'Accept: application/json'];
|
$headers = ['Content-Type: application/json', 'Accept: application/json'];
|
||||||
@@ -459,6 +465,18 @@ class SmartAssistantService
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getEspocrmApiKey(): ?string
|
||||||
|
{
|
||||||
|
$integration = $this->entityManager->getEntityById('Integration', 'SmartAssistant');
|
||||||
|
if ($integration && $integration->get('enabled')) {
|
||||||
|
$data = $integration->get('data') ?? (object) [];
|
||||||
|
if (!empty($data->espocrmApiKey)) {
|
||||||
|
return $data->espocrmApiKey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private function getThresholds(): array
|
private function getThresholds(): array
|
||||||
{
|
{
|
||||||
$integration = $this->entityManager->getEntityById('Integration', 'SmartAssistant');
|
$integration = $this->entityManager->getEntityById('Integration', 'SmartAssistant');
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
"module": "SmartAssistant",
|
"module": "SmartAssistant",
|
||||||
"description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and AI Gateway integration",
|
"description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and AI Gateway integration",
|
||||||
"author": "klear",
|
"author": "klear",
|
||||||
"version": "2.1.3",
|
"version": "2.2.0",
|
||||||
"acceptableVersions": [
|
"acceptableVersions": [
|
||||||
">=8.0.0"
|
">=8.0.0"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user