@xuda.io/account_module 1.2.1258 → 1.2.1260
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 +7 -37
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1056,23 +1056,7 @@ export const read_emails = async function (req, job_id, headers) {
|
|
|
1056
1056
|
|
|
1057
1057
|
for await (let [email, data] of Object.entries(is_sent ? recipient : senders)) {
|
|
1058
1058
|
const { name, subject, is_sent } = data;
|
|
1059
|
-
|
|
1060
|
-
// "xuda_contacts",
|
|
1061
|
-
// "contacts_by_email_address",
|
|
1062
|
-
// { key: [uid, email] }
|
|
1063
|
-
// );
|
|
1064
|
-
|
|
1065
|
-
// if (!contact_ret.rows.length) {
|
|
1066
|
-
// await db_module.save_couch_doc("xuda_contacts", {
|
|
1067
|
-
// _id: await _common.xuda_get_uuid("contact"),
|
|
1068
|
-
// email: [email],
|
|
1069
|
-
// name,
|
|
1070
|
-
// stat: 1,
|
|
1071
|
-
// date_created: Date.now(),
|
|
1072
|
-
// docType: "contact",
|
|
1073
|
-
// uid,
|
|
1074
|
-
// });
|
|
1075
|
-
// }
|
|
1059
|
+
|
|
1076
1060
|
await add_contact({ uid, name, email, metadata: { subject, is_sent }, source: 'read emails' }, job_id, headers);
|
|
1077
1061
|
}
|
|
1078
1062
|
}
|
|
@@ -1570,7 +1554,6 @@ export const get_pending_share_contact_in = async function (uid, _id) {
|
|
|
1570
1554
|
const requests_from_res = await db_module.find_couch_query('xuda_team', from_opt);
|
|
1571
1555
|
|
|
1572
1556
|
for await (let e of requests_from_res.docs) {
|
|
1573
|
-
// let doc = { docType: 'contact', date_created: e.team_req_date, email: [e.sender_account_info.email], name: '', pending: true, contact_uid: e.team_req_from_uid, team_req_id: e._id };
|
|
1574
1557
|
let doc = await db_module.get_couch_doc_native('xuda_contacts', e.share_item_id);
|
|
1575
1558
|
delete doc.contact_mood_level;
|
|
1576
1559
|
doc.shared_from_uid = e.team_req_from_uid;
|
|
@@ -1601,24 +1584,6 @@ const get_user_contact = async function (uid, uid_query) {
|
|
|
1601
1584
|
return doc;
|
|
1602
1585
|
};
|
|
1603
1586
|
|
|
1604
|
-
// invite user
|
|
1605
|
-
|
|
1606
|
-
// const contact_ret = await db_module.get_couch_view_raw(
|
|
1607
|
-
// "xuda_contacts",
|
|
1608
|
-
// "contacts_by_name_count",
|
|
1609
|
-
// {
|
|
1610
|
-
// startkey: [uid, ""],
|
|
1611
|
-
// endkey: [uid, "ZZZZZZZZZZ"],
|
|
1612
|
-
// reduce: true,
|
|
1613
|
-
// group_level: 2,
|
|
1614
|
-
// }
|
|
1615
|
-
// );
|
|
1616
|
-
|
|
1617
|
-
// const get_contact_id = async function (uid, contact_uid) {
|
|
1618
|
-
// contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, contact_uid] });
|
|
1619
|
-
// return contact_ret?.rows?.[0]?.id;
|
|
1620
|
-
// };
|
|
1621
|
-
|
|
1622
1587
|
export const update_contact = async function (req) {
|
|
1623
1588
|
const { uid, email, contact_uid, stat, team_req_id } = req;
|
|
1624
1589
|
|
|
@@ -1955,7 +1920,7 @@ export const update_contacts_with_account_changes = async function (uid, changes
|
|
|
1955
1920
|
export const get_user_card = async function (uid, uid_query) {
|
|
1956
1921
|
if (uid === uid_query) return await get_user_contact(uid, uid_query);
|
|
1957
1922
|
|
|
1958
|
-
let user_contact_obj;
|
|
1923
|
+
let user_contact_obj;
|
|
1959
1924
|
|
|
1960
1925
|
const contact_ret = await db_module.get_couch_view_raw('xuda_contacts', 'contacts_by_contact_uid', { key: [uid, uid_query] });
|
|
1961
1926
|
|
|
@@ -2953,3 +2918,8 @@ export const update_account_profile = async function (req, job_id, headers) {
|
|
|
2953
2918
|
return { code: -56, data: err.message };
|
|
2954
2919
|
}
|
|
2955
2920
|
};
|
|
2921
|
+
|
|
2922
|
+
const get_contact = async function (uid, contact_id) {
|
|
2923
|
+
const account_profile_info = await get_active_account_profile_info(uid);
|
|
2924
|
+
const contact_ret = await db_module.get_app_couch_doc(account_profile_info.app_id, contact_id);
|
|
2925
|
+
};
|