@xuda.io/account_module 1.2.510 → 1.2.512

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.
Files changed (2) hide show
  1. package/index.mjs +4 -35
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1258,6 +1258,7 @@ const get_contact_border = function (doc) {
1258
1258
  };
1259
1259
 
1260
1260
  export const get_contact_info = async function (contact_doc, _id) {
1261
+ const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1261
1262
  let doc = contact_doc;
1262
1263
  if (_id) {
1263
1264
  doc = await db_module.get_couch_doc_native('xuda_contacts', _id);
@@ -1291,7 +1292,9 @@ export const get_contact_info = async function (contact_doc, _id) {
1291
1292
  doc.icon_pattern = get_contact_pattern(doc);
1292
1293
  }
1293
1294
 
1294
- const chats_ret = await get_ai_chats({ uid, reference_id: doc._id });
1295
+ const chats_ret = await ai_module.get_ai_chats({ uid, reference_id: doc._id });
1296
+ for await (let doc of chats_ret.data.docs) {
1297
+ }
1295
1298
 
1296
1299
  doc.border = get_contact_border(doc);
1297
1300
  if (!doc.name) {
@@ -1360,40 +1363,6 @@ export const get_contacts = async function (req) {
1360
1363
  const contacts = await db_module.find_couch_query('xuda_contacts', opt);
1361
1364
 
1362
1365
  for await (let doc of contacts.docs) {
1363
- // if (doc.contact_uid) {
1364
- // const account_info_ret = await get_account_name({ uid_query: doc.contact_uid });
1365
- // if (account_info_ret.code < 0) {
1366
- // continue; // throw new Error(`account ${contact_uid} not found`);
1367
- // }
1368
-
1369
- // doc.profile_avatar = account_info_ret.data.profile_avatar;
1370
-
1371
- // doc.card_background = get_contact_background(doc);
1372
-
1373
- // //membership_plan
1374
- // doc.name = `${account_info_ret.data.first_name} ${account_info_ret.data.last_name}`;
1375
-
1376
- // doc.telephone = account_info_ret.data.phone;
1377
-
1378
- // // doc.notifications = 45;
1379
- // // doc.online = true;
1380
- // if (doc.team_req_id) {
1381
- // try {
1382
- // const req_doc = await db_module.get_couch_doc_native('xuda_team', doc.team_req_id);
1383
- // doc.connection_stat = req_doc.team_req_stat;
1384
- // } catch (error) {
1385
- // doc.connection_stat = 0;
1386
- // }
1387
- // }
1388
-
1389
- // doc.icon_pattern = get_contact_pattern(doc);
1390
- // }
1391
- // doc.border = get_contact_border(doc);
1392
- // if (!doc.name) {
1393
- // doc.name = doc.email;
1394
- // }
1395
-
1396
- // doc.email = '';
1397
1366
  doc = await get_contact_info(doc);
1398
1367
  }
1399
1368
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.510",
3
+ "version": "1.2.512",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {