@xuda.io/account_module 1.2.1325 → 1.2.1327
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 +3 -68
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1694,71 +1694,6 @@ export const get_account_default_project_id = async function (uid) {
|
|
|
1694
1694
|
return account_obj.account_project_id;
|
|
1695
1695
|
};
|
|
1696
1696
|
|
|
1697
|
-
setTimeout(async () => {
|
|
1698
|
-
// const uid = "0489f946c213947316647b468f029ed9"; //"aecc740881fd0a35098c738652000fab";
|
|
1699
|
-
|
|
1700
|
-
// // // clear data
|
|
1701
|
-
// // const contact_ret = await db_module.find_couch_query("xuda_contacts", {
|
|
1702
|
-
// // selector: {
|
|
1703
|
-
// // docType: "contact",
|
|
1704
|
-
// // },
|
|
1705
|
-
// // limit: 99999,
|
|
1706
|
-
// // });
|
|
1707
|
-
// // var contact_docs = [];
|
|
1708
|
-
// // for (let val of contact_ret.docs) {
|
|
1709
|
-
// // val._deleted = true;
|
|
1710
|
-
// // contact_docs.push(val);
|
|
1711
|
-
// // }
|
|
1712
|
-
// // await db_module.save_couch_bulk_docs("xuda_contacts", contact_docs);
|
|
1713
|
-
|
|
1714
|
-
// // const emails_ret = await db_module.find_couch_query("xuda_emails", {
|
|
1715
|
-
// // selector: {
|
|
1716
|
-
// // docType: "email",
|
|
1717
|
-
// // },
|
|
1718
|
-
// // limit: 99999,
|
|
1719
|
-
// // });
|
|
1720
|
-
// // var email_docs = [];
|
|
1721
|
-
// // for (let val of emails_ret.docs) {
|
|
1722
|
-
// // val._deleted = true;
|
|
1723
|
-
// // email_docs.push(val);
|
|
1724
|
-
// // }
|
|
1725
|
-
|
|
1726
|
-
// // await db_module.save_couch_bulk_docs("xuda_emails", email_docs);
|
|
1727
|
-
|
|
1728
|
-
// ///////////////////////////////////
|
|
1729
|
-
// return;
|
|
1730
|
-
// const email_account_ret = await get_email_accounts({
|
|
1731
|
-
// uid,
|
|
1732
|
-
// });
|
|
1733
|
-
|
|
1734
|
-
// var accessToken;
|
|
1735
|
-
// for await (let email_account of email_account_ret.data.docs) {
|
|
1736
|
-
// switch (email_account.vendor) {
|
|
1737
|
-
// case "gmail":
|
|
1738
|
-
// const ret = await generate_gmail_access_token(email_account);
|
|
1739
|
-
// accessToken = ret.access_token;
|
|
1740
|
-
// break;
|
|
1741
|
-
|
|
1742
|
-
// default:
|
|
1743
|
-
// break;
|
|
1744
|
-
// }
|
|
1745
|
-
|
|
1746
|
-
// read_emails({
|
|
1747
|
-
// uid,
|
|
1748
|
-
// email_account_address: email_account.email,
|
|
1749
|
-
// accessToken,
|
|
1750
|
-
// email_account_id: email_account._id,
|
|
1751
|
-
// vendor: email_account.vendor,
|
|
1752
|
-
// });
|
|
1753
|
-
// }
|
|
1754
|
-
|
|
1755
|
-
// // console.log(await get_contact({ uid, name: "bo" }));
|
|
1756
|
-
|
|
1757
|
-
let ret;
|
|
1758
|
-
// ret = await add_contact({ uid: 'd39126e0e2c51ffbd1aad10709fc8335', name: 'Boaz Avrahami', email: 'bocabo67@gmail.com', context: {} }, null, { 'accept-language': 'en-US,en;q=0.9,he;q=0.8' });
|
|
1759
|
-
console.log(ret);
|
|
1760
|
-
}, 2000);
|
|
1761
|
-
|
|
1762
1697
|
export const get_user_name = async function (uid) {
|
|
1763
1698
|
try {
|
|
1764
1699
|
const account_info = await get_account_name({ uid });
|
|
@@ -2791,7 +2726,7 @@ export const unarchive_account_profile = async function (req) {
|
|
|
2791
2726
|
};
|
|
2792
2727
|
|
|
2793
2728
|
export const create_account_profile = async function (req, job_id, headers) {
|
|
2794
|
-
const { uid, profile_name, profile_signature,
|
|
2729
|
+
const { uid, profile_name, profile_signature, email_account_id, profile_picture, profile_avatar, profile_picture_obj, profile_avatar_obj, main } = req;
|
|
2795
2730
|
try {
|
|
2796
2731
|
const app_id = await get_account_default_project_id(uid);
|
|
2797
2732
|
// const { data: acc_obj } = await db_module.get_couch_doc('xuda_accounts', uid);
|
|
@@ -2807,7 +2742,7 @@ export const create_account_profile = async function (req, job_id, headers) {
|
|
|
2807
2742
|
uid,
|
|
2808
2743
|
profile_name, //: profile_name || acc_obj.account_info.business_name || acc_obj.account_info.name,
|
|
2809
2744
|
profile_signature,
|
|
2810
|
-
|
|
2745
|
+
email_account_id,
|
|
2811
2746
|
profile_picture,
|
|
2812
2747
|
profile_avatar,
|
|
2813
2748
|
profile_picture_obj,
|
|
@@ -2827,7 +2762,7 @@ export const create_account_profile = async function (req, job_id, headers) {
|
|
|
2827
2762
|
export const update_account_profile = async function (req, job_id, headers) {
|
|
2828
2763
|
const { uid, _id } = req;
|
|
2829
2764
|
const app_id = await get_account_default_project_id(uid);
|
|
2830
|
-
const account_profile_properties = ['profile_name', 'profile_signature', '
|
|
2765
|
+
const account_profile_properties = ['profile_name', 'profile_signature', 'email_account_id', 'profile_picture', 'profile_avatar', 'profile_picture_obj', 'profile_avatar_obj', 'auto_respond', 'auto_respond_mode', 'auto_respond_agents'];
|
|
2831
2766
|
try {
|
|
2832
2767
|
let { data: account_profile_doc } = await db_module.get_app_couch_doc(app_id, _id);
|
|
2833
2768
|
|