@xuda.io/account_module 1.2.162 → 1.2.163

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 +18 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1482,3 +1482,21 @@ export const get_account_default_project_id = async function (uid) {
1482
1482
 
1483
1483
  // // console.log(await get_contact({ uid, name: "bo" }));
1484
1484
  // }, 2000);
1485
+
1486
+ export const get_user_name = async function (uid) {
1487
+ try {
1488
+ const account_info = await get_account_name(uid);
1489
+ let username = 'unknown';
1490
+ if (account_info) {
1491
+ username = account_info.first_name + ' ' + account_info.last_name;
1492
+
1493
+ if (!username) {
1494
+ username = +account_info.email;
1495
+ }
1496
+ }
1497
+
1498
+ return username;
1499
+ } catch (err) {
1500
+ return 'unknown';
1501
+ }
1502
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.162",
3
+ "version": "1.2.163",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {