@xuda.io/account_module 1.2.798 → 1.2.800

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 +15 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1535,7 +1535,7 @@ const get_user_contact = async function (uid, uid_query) {
1535
1535
  };
1536
1536
 
1537
1537
  export const get_contacts = async function (req) {
1538
- const { _id, uid, name, limit, skip, bookmark, search, with_requests } = req;
1538
+ const { _id, uid, name, limit, skip, bookmark, search, with_requests, filter_type = 'all' } = req;
1539
1539
  var opt = {
1540
1540
  selector: {
1541
1541
  docType: 'contact',
@@ -1546,6 +1546,20 @@ export const get_contacts = async function (req) {
1546
1546
  skip: skip || 0,
1547
1547
  };
1548
1548
 
1549
+ switch (filter_type) {
1550
+ case 'archived': {
1551
+ opt.selector.stat = 0;
1552
+ break;
1553
+ }
1554
+ case 'shared': {
1555
+ opt.selector['studio_meta.shared_from_uid'] = { $gt: null };
1556
+ break;
1557
+ }
1558
+
1559
+ default:
1560
+ break;
1561
+ }
1562
+
1549
1563
  if (_id) {
1550
1564
  opt.selector._id = _id;
1551
1565
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.798",
3
+ "version": "1.2.800",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {