@xuda.io/account_module 1.2.211 → 1.2.213
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 +63 -60
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1186,6 +1186,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1186
1186
|
const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
1187
1187
|
// const prompt = ``;
|
|
1188
1188
|
// const images_arr = await ai_module.create_and_upload_image_to_drive('user', 'Profile Images', ret.id, prompt, 1, uid, app_id, job_id, headers);
|
|
1189
|
+
debugger;
|
|
1189
1190
|
ai_module.update_thumbnail('contact', doc, app_id, uid, job_id, headers);
|
|
1190
1191
|
|
|
1191
1192
|
return ret;
|
|
@@ -1428,66 +1429,68 @@ export const get_account_default_project_id = async function (uid) {
|
|
|
1428
1429
|
return account_obj.account_project_id;
|
|
1429
1430
|
};
|
|
1430
1431
|
|
|
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
|
-
|
|
1432
|
+
setTimeout(async () => {
|
|
1433
|
+
// const uid = "0489f946c213947316647b468f029ed9"; //"aecc740881fd0a35098c738652000fab";
|
|
1434
|
+
|
|
1435
|
+
// // // clear data
|
|
1436
|
+
// // const contact_ret = await db_module.find_couch_query("xuda_contacts", {
|
|
1437
|
+
// // selector: {
|
|
1438
|
+
// // docType: "contact",
|
|
1439
|
+
// // },
|
|
1440
|
+
// // limit: 99999,
|
|
1441
|
+
// // });
|
|
1442
|
+
// // var contact_docs = [];
|
|
1443
|
+
// // for (let val of contact_ret.docs) {
|
|
1444
|
+
// // val._deleted = true;
|
|
1445
|
+
// // contact_docs.push(val);
|
|
1446
|
+
// // }
|
|
1447
|
+
// // await db_module.save_couch_bulk_docs("xuda_contacts", contact_docs);
|
|
1448
|
+
|
|
1449
|
+
// // const emails_ret = await db_module.find_couch_query("xuda_emails", {
|
|
1450
|
+
// // selector: {
|
|
1451
|
+
// // docType: "email",
|
|
1452
|
+
// // },
|
|
1453
|
+
// // limit: 99999,
|
|
1454
|
+
// // });
|
|
1455
|
+
// // var email_docs = [];
|
|
1456
|
+
// // for (let val of emails_ret.docs) {
|
|
1457
|
+
// // val._deleted = true;
|
|
1458
|
+
// // email_docs.push(val);
|
|
1459
|
+
// // }
|
|
1460
|
+
|
|
1461
|
+
// // await db_module.save_couch_bulk_docs("xuda_emails", email_docs);
|
|
1462
|
+
|
|
1463
|
+
// ///////////////////////////////////
|
|
1464
|
+
// return;
|
|
1465
|
+
// const email_account_ret = await get_email_accounts({
|
|
1466
|
+
// uid,
|
|
1467
|
+
// });
|
|
1468
|
+
|
|
1469
|
+
// var accessToken;
|
|
1470
|
+
// for await (let email_account of email_account_ret.data.docs) {
|
|
1471
|
+
// switch (email_account.vendor) {
|
|
1472
|
+
// case "gmail":
|
|
1473
|
+
// const ret = await generate_gmail_access_token(email_account);
|
|
1474
|
+
// accessToken = ret.access_token;
|
|
1475
|
+
// break;
|
|
1476
|
+
|
|
1477
|
+
// default:
|
|
1478
|
+
// break;
|
|
1479
|
+
// }
|
|
1480
|
+
|
|
1481
|
+
// read_emails({
|
|
1482
|
+
// uid,
|
|
1483
|
+
// email_account_address: email_account.email,
|
|
1484
|
+
// accessToken,
|
|
1485
|
+
// email_account_id: email_account._id,
|
|
1486
|
+
// vendor: email_account.vendor,
|
|
1487
|
+
// });
|
|
1488
|
+
// }
|
|
1489
|
+
|
|
1490
|
+
// // console.log(await get_contact({ uid, name: "bo" }));
|
|
1491
|
+
|
|
1492
|
+
await add_contact({ uid: 'd39126e0e2c51ffbd1aad10709fc8335', name: 'Ishai Avrahami', email: 'ishai054@gmail.com', context: {} }, null, { 'accept-language': 'en-US,en;q=0.9,he;q=0.8' });
|
|
1493
|
+
}, 2000);
|
|
1491
1494
|
|
|
1492
1495
|
export const get_user_name = async function (uid) {
|
|
1493
1496
|
try {
|