@xuda.io/account_module 1.2.211 → 1.2.212
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 +62 -60
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1428,66 +1428,68 @@ export const get_account_default_project_id = async function (uid) {
|
|
|
1428
1428
|
return account_obj.account_project_id;
|
|
1429
1429
|
};
|
|
1430
1430
|
|
|
1431
|
-
|
|
1432
|
-
// const uid = "0489f946c213947316647b468f029ed9"; //"aecc740881fd0a35098c738652000fab";
|
|
1433
|
-
|
|
1434
|
-
// // // clear data
|
|
1435
|
-
// // const contact_ret = await db_module.find_couch_query("xuda_contacts", {
|
|
1436
|
-
// // selector: {
|
|
1437
|
-
// // docType: "contact",
|
|
1438
|
-
// // },
|
|
1439
|
-
// // limit: 99999,
|
|
1440
|
-
// // });
|
|
1441
|
-
// // var contact_docs = [];
|
|
1442
|
-
// // for (let val of contact_ret.docs) {
|
|
1443
|
-
// // val._deleted = true;
|
|
1444
|
-
// // contact_docs.push(val);
|
|
1445
|
-
// // }
|
|
1446
|
-
// // await db_module.save_couch_bulk_docs("xuda_contacts", contact_docs);
|
|
1447
|
-
|
|
1448
|
-
// // const emails_ret = await db_module.find_couch_query("xuda_emails", {
|
|
1449
|
-
// // selector: {
|
|
1450
|
-
// // docType: "email",
|
|
1451
|
-
// // },
|
|
1452
|
-
// // limit: 99999,
|
|
1453
|
-
// // });
|
|
1454
|
-
// // var email_docs = [];
|
|
1455
|
-
// // for (let val of emails_ret.docs) {
|
|
1456
|
-
// // val._deleted = true;
|
|
1457
|
-
// // email_docs.push(val);
|
|
1458
|
-
// // }
|
|
1459
|
-
|
|
1460
|
-
// // await db_module.save_couch_bulk_docs("xuda_emails", email_docs);
|
|
1461
|
-
|
|
1462
|
-
// ///////////////////////////////////
|
|
1463
|
-
// return;
|
|
1464
|
-
// const email_account_ret = await get_email_accounts({
|
|
1465
|
-
// uid,
|
|
1466
|
-
// });
|
|
1467
|
-
|
|
1468
|
-
// var accessToken;
|
|
1469
|
-
// for await (let email_account of email_account_ret.data.docs) {
|
|
1470
|
-
// switch (email_account.vendor) {
|
|
1471
|
-
// case "gmail":
|
|
1472
|
-
// const ret = await generate_gmail_access_token(email_account);
|
|
1473
|
-
// accessToken = ret.access_token;
|
|
1474
|
-
// break;
|
|
1475
|
-
|
|
1476
|
-
// default:
|
|
1477
|
-
// break;
|
|
1478
|
-
// }
|
|
1479
|
-
|
|
1480
|
-
// read_emails({
|
|
1481
|
-
// uid,
|
|
1482
|
-
// email_account_address: email_account.email,
|
|
1483
|
-
// accessToken,
|
|
1484
|
-
// email_account_id: email_account._id,
|
|
1485
|
-
// vendor: email_account.vendor,
|
|
1486
|
-
// });
|
|
1487
|
-
// }
|
|
1488
|
-
|
|
1489
|
-
// // console.log(await get_contact({ uid, name: "bo" }));
|
|
1490
|
-
|
|
1431
|
+
setTimeout(async () => {
|
|
1432
|
+
// const uid = "0489f946c213947316647b468f029ed9"; //"aecc740881fd0a35098c738652000fab";
|
|
1433
|
+
|
|
1434
|
+
// // // clear data
|
|
1435
|
+
// // const contact_ret = await db_module.find_couch_query("xuda_contacts", {
|
|
1436
|
+
// // selector: {
|
|
1437
|
+
// // docType: "contact",
|
|
1438
|
+
// // },
|
|
1439
|
+
// // limit: 99999,
|
|
1440
|
+
// // });
|
|
1441
|
+
// // var contact_docs = [];
|
|
1442
|
+
// // for (let val of contact_ret.docs) {
|
|
1443
|
+
// // val._deleted = true;
|
|
1444
|
+
// // contact_docs.push(val);
|
|
1445
|
+
// // }
|
|
1446
|
+
// // await db_module.save_couch_bulk_docs("xuda_contacts", contact_docs);
|
|
1447
|
+
|
|
1448
|
+
// // const emails_ret = await db_module.find_couch_query("xuda_emails", {
|
|
1449
|
+
// // selector: {
|
|
1450
|
+
// // docType: "email",
|
|
1451
|
+
// // },
|
|
1452
|
+
// // limit: 99999,
|
|
1453
|
+
// // });
|
|
1454
|
+
// // var email_docs = [];
|
|
1455
|
+
// // for (let val of emails_ret.docs) {
|
|
1456
|
+
// // val._deleted = true;
|
|
1457
|
+
// // email_docs.push(val);
|
|
1458
|
+
// // }
|
|
1459
|
+
|
|
1460
|
+
// // await db_module.save_couch_bulk_docs("xuda_emails", email_docs);
|
|
1461
|
+
|
|
1462
|
+
// ///////////////////////////////////
|
|
1463
|
+
// return;
|
|
1464
|
+
// const email_account_ret = await get_email_accounts({
|
|
1465
|
+
// uid,
|
|
1466
|
+
// });
|
|
1467
|
+
|
|
1468
|
+
// var accessToken;
|
|
1469
|
+
// for await (let email_account of email_account_ret.data.docs) {
|
|
1470
|
+
// switch (email_account.vendor) {
|
|
1471
|
+
// case "gmail":
|
|
1472
|
+
// const ret = await generate_gmail_access_token(email_account);
|
|
1473
|
+
// accessToken = ret.access_token;
|
|
1474
|
+
// break;
|
|
1475
|
+
|
|
1476
|
+
// default:
|
|
1477
|
+
// break;
|
|
1478
|
+
// }
|
|
1479
|
+
|
|
1480
|
+
// read_emails({
|
|
1481
|
+
// uid,
|
|
1482
|
+
// email_account_address: email_account.email,
|
|
1483
|
+
// accessToken,
|
|
1484
|
+
// email_account_id: email_account._id,
|
|
1485
|
+
// vendor: email_account.vendor,
|
|
1486
|
+
// });
|
|
1487
|
+
// }
|
|
1488
|
+
|
|
1489
|
+
// // console.log(await get_contact({ uid, name: "bo" }));
|
|
1490
|
+
|
|
1491
|
+
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' });
|
|
1492
|
+
}, 2000);
|
|
1491
1493
|
|
|
1492
1494
|
export const get_user_name = async function (uid) {
|
|
1493
1495
|
try {
|