@xuda.io/account_module 1.2.31 → 1.2.33

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.js +63 -61
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1127,67 +1127,6 @@ const generate_gmail_access_token = async function (email_account) {
1127
1127
  });
1128
1128
  };
1129
1129
 
1130
- setTimeout(async () => {
1131
- const uid = "0489f946c213947316647b468f029ed9"; //"aecc740881fd0a35098c738652000fab";
1132
-
1133
- // // clear data
1134
- // const contact_ret = await db_module.find_couch_query("xuda_contacts", {
1135
- // selector: {
1136
- // docType: "contact",
1137
- // },
1138
- // limit: 99999,
1139
- // });
1140
- // var contact_docs = [];
1141
- // for (let val of contact_ret.docs) {
1142
- // val._deleted = true;
1143
- // contact_docs.push(val);
1144
- // }
1145
- // await db_module.sava_couch_bulk_docs("xuda_contacts", contact_docs);
1146
-
1147
- // const emails_ret = await db_module.find_couch_query("xuda_emails", {
1148
- // selector: {
1149
- // docType: "email",
1150
- // },
1151
- // limit: 99999,
1152
- // });
1153
- // var email_docs = [];
1154
- // for (let val of emails_ret.docs) {
1155
- // val._deleted = true;
1156
- // email_docs.push(val);
1157
- // }
1158
-
1159
- // await db_module.sava_couch_bulk_docs("xuda_emails", email_docs);
1160
-
1161
- ///////////////////////////////////
1162
- return;
1163
- const email_account_ret = await module.exports.get_email_accounts({
1164
- uid,
1165
- });
1166
-
1167
- var accessToken;
1168
- for await (let email_account of email_account_ret.data.docs) {
1169
- switch (email_account.vendor) {
1170
- case "gmail":
1171
- const ret = await generate_gmail_access_token(email_account);
1172
- accessToken = ret.access_token;
1173
- break;
1174
-
1175
- default:
1176
- break;
1177
- }
1178
-
1179
- module.exports.read_emails({
1180
- uid,
1181
- email_account_address: email_account.email,
1182
- accessToken,
1183
- email_account_id: email_account._id,
1184
- vendor: email_account.vendor,
1185
- });
1186
- }
1187
-
1188
- // console.log(await module.exports.get_contact({ uid, name: "bo" }));
1189
- }, 2000);
1190
-
1191
1130
  exports.find_contact_duplicates = async function (req) {
1192
1131
  const { uid, name } = req;
1193
1132
  var opt = {
@@ -1453,3 +1392,66 @@ exports.get_account_rt_info = async function (uid) {
1453
1392
  account_info.uid = doc_ret.data._id;
1454
1393
  return account_info;
1455
1394
  };
1395
+
1396
+ exports.validate_account_topup = async function (uid) {};
1397
+
1398
+ // setTimeout(async () => {
1399
+ // const uid = "0489f946c213947316647b468f029ed9"; //"aecc740881fd0a35098c738652000fab";
1400
+
1401
+ // // // clear data
1402
+ // // const contact_ret = await db_module.find_couch_query("xuda_contacts", {
1403
+ // // selector: {
1404
+ // // docType: "contact",
1405
+ // // },
1406
+ // // limit: 99999,
1407
+ // // });
1408
+ // // var contact_docs = [];
1409
+ // // for (let val of contact_ret.docs) {
1410
+ // // val._deleted = true;
1411
+ // // contact_docs.push(val);
1412
+ // // }
1413
+ // // await db_module.sava_couch_bulk_docs("xuda_contacts", contact_docs);
1414
+
1415
+ // // const emails_ret = await db_module.find_couch_query("xuda_emails", {
1416
+ // // selector: {
1417
+ // // docType: "email",
1418
+ // // },
1419
+ // // limit: 99999,
1420
+ // // });
1421
+ // // var email_docs = [];
1422
+ // // for (let val of emails_ret.docs) {
1423
+ // // val._deleted = true;
1424
+ // // email_docs.push(val);
1425
+ // // }
1426
+
1427
+ // // await db_module.sava_couch_bulk_docs("xuda_emails", email_docs);
1428
+
1429
+ // ///////////////////////////////////
1430
+ // return;
1431
+ // const email_account_ret = await module.exports.get_email_accounts({
1432
+ // uid,
1433
+ // });
1434
+
1435
+ // var accessToken;
1436
+ // for await (let email_account of email_account_ret.data.docs) {
1437
+ // switch (email_account.vendor) {
1438
+ // case "gmail":
1439
+ // const ret = await generate_gmail_access_token(email_account);
1440
+ // accessToken = ret.access_token;
1441
+ // break;
1442
+
1443
+ // default:
1444
+ // break;
1445
+ // }
1446
+
1447
+ // module.exports.read_emails({
1448
+ // uid,
1449
+ // email_account_address: email_account.email,
1450
+ // accessToken,
1451
+ // email_account_id: email_account._id,
1452
+ // vendor: email_account.vendor,
1453
+ // });
1454
+ // }
1455
+
1456
+ // // console.log(await module.exports.get_contact({ uid, name: "bo" }));
1457
+ // }, 2000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.31",
3
+ "version": "1.2.33",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {