@xuda.io/account_module 1.2.1710 → 1.2.1712
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.
- package/index.mjs +10 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2079,7 +2079,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2079
2079
|
/////////////////
|
|
2080
2080
|
|
|
2081
2081
|
let is_spam = false;
|
|
2082
|
-
|
|
2082
|
+
let account_type_info;
|
|
2083
2083
|
let account_type;
|
|
2084
2084
|
let cached_contact;
|
|
2085
2085
|
if (contact_uid) {
|
|
@@ -2104,6 +2104,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2104
2104
|
is_spam = await ai_module.is_spam_email(uid, email, metadata.subject, account_profile_info);
|
|
2105
2105
|
}
|
|
2106
2106
|
|
|
2107
|
+
account_type_info = await ai_module.analyze_email_account_type(uid, contact_obj.name, contact_obj.email, account_profile_info, metadata?.summarized_body);
|
|
2107
2108
|
const is_business = await ai_module.is_business_contact(uid, email, name, metadata.subject, metadata.summarized_body, account_profile_info);
|
|
2108
2109
|
account_type = is_business ? 'business' : 'personal';
|
|
2109
2110
|
}
|
|
@@ -2157,6 +2158,9 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2157
2158
|
|
|
2158
2159
|
if (account_type === 'personal') {
|
|
2159
2160
|
contact_obj.person_info = await ai_module.get_person_info(uid, contact_obj.name, contact_obj.email, account_profile_info, metadata?.summarized_body);
|
|
2161
|
+
if (!contact_obj.name) {
|
|
2162
|
+
contact_obj.name = await ai_module.get_name_from_email_addr(uid, contact_obj.email, account_profile_info);
|
|
2163
|
+
}
|
|
2160
2164
|
}
|
|
2161
2165
|
} else {
|
|
2162
2166
|
if (!contact_obj.name) {
|
|
@@ -2164,11 +2168,11 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2164
2168
|
}
|
|
2165
2169
|
}
|
|
2166
2170
|
|
|
2167
|
-
if (account_type === 'personal') {
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
}
|
|
2171
|
+
// if (account_type === 'personal') {
|
|
2172
|
+
// if (!contact_obj.name) {
|
|
2173
|
+
// contact_obj.name = await ai_module.get_name_from_email_addr(uid, contact_obj.email, account_profile_info);
|
|
2174
|
+
// }
|
|
2175
|
+
// }
|
|
2172
2176
|
}
|
|
2173
2177
|
// else {
|
|
2174
2178
|
// // get from cache
|