@xuda.io/account_module 1.2.457 → 1.2.459

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 +49 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1174,8 +1174,51 @@ const get_contact_background = function (doc) {
1174
1174
  }
1175
1175
 
1176
1176
  switch (doc.contact_mood) {
1177
+ case -2: {
1178
+ ret = `linear-gradient(145deg, #f60404d8 0%, #7f98e344 100%)`;
1179
+ break;
1180
+ }
1181
+ case -1: {
1182
+ ret = `linear-gradient(145deg, #f6040452 0%, #7f98e344 100%)`;
1183
+ break;
1184
+ }
1185
+ case 1: {
1186
+ ret = `linear-gradient(145deg, #04f61452 0%, #7f98e344 100%)`;
1187
+ break;
1188
+ }
1189
+ case 2: {
1190
+ ret = `linear-gradient(145deg, #30f604c9 0%, #7f98e344 100%)`;
1191
+ break;
1192
+ }
1193
+ default:
1194
+ break;
1195
+ }
1196
+
1197
+ return ret;
1198
+ };
1199
+
1200
+ const get_contact_pattern = function (doc) {
1201
+ const ret = `linear-gradient(145deg,#60496e8c 0%,#71C4FF44 100%)`;
1202
+
1203
+ if (doc.pending) {
1204
+ ret = `linear-gradient(145deg, #4f4f4f8c 0%, #0e0f0f44 100%);`;
1205
+ }
1206
+
1207
+ switch (doc.contact_mood) {
1208
+ case -2: {
1209
+ ret = `linear-gradient(145deg, #f60404d8 0%, #7f98e344 100%)`;
1210
+ break;
1211
+ }
1212
+ case -1: {
1213
+ ret = `linear-gradient(145deg, #f6040452 0%, #7f98e344 100%)`;
1214
+ break;
1215
+ }
1216
+ case 1: {
1217
+ ret = `linear-gradient(145deg, #04f61452 0%, #7f98e344 100%)`;
1218
+ break;
1219
+ }
1177
1220
  case 2: {
1178
- ret = `linear-gradient(145deg, #d703038c 0%, #7f98e344 100%)`;
1221
+ ret = `linear-gradient(145deg, #30f604c9 0%, #7f98e344 100%)`;
1179
1222
  break;
1180
1223
  }
1181
1224
  default:
@@ -1186,7 +1229,7 @@ const get_contact_background = function (doc) {
1186
1229
  };
1187
1230
 
1188
1231
  export const get_contacts = async function (req) {
1189
- const { uid, name, limit, skip, bookmark, search, with_requests } = req;
1232
+ const { _id, uid, name, limit, skip, bookmark, search, with_requests } = req;
1190
1233
  var opt = {
1191
1234
  selector: {
1192
1235
  docType: 'contact',
@@ -1208,6 +1251,10 @@ export const get_contacts = async function (req) {
1208
1251
  limit: limit ? limit : 99999,
1209
1252
  };
1210
1253
 
1254
+ if (_id) {
1255
+ opt.selector._id = _id;
1256
+ }
1257
+
1211
1258
  if (typeof name !== 'undefined') {
1212
1259
  opt.selector.name = { $regex: `(?i)${name}` };
1213
1260
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.457",
3
+ "version": "1.2.459",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {