@beam3_dev/api_module 0.0.270 → 0.0.272

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.
package/dist/wb3Api.js CHANGED
@@ -2314,23 +2314,24 @@ function ht(e, t = void 0, s = void 0) {
2314
2314
  function yt(e, t = void 0, s = void 0) {
2315
2315
  return new Promise((n, i) => {
2316
2316
  try {
2317
- const { _3DDashboard: r, _3DSwym: o } = e;
2318
- let a;
2319
- if (console.log("_3DSwym_get_currentUser", e), r) {
2320
- const c = r + "/api/users/current";
2321
- m(c, {
2317
+ let r;
2318
+ if (e._3DDashboard) {
2319
+ const o = e._3DDashboard + "/api/users/current";
2320
+ console.log("_3DSwym_get_currentUser | url", o), m(o, {
2322
2321
  method: "GET",
2323
- onComplete(d, u, p) {
2324
- console.log("_3DSwym_get_currentUser | response", d);
2325
- const f = JSON.parse(d);
2326
- f.first_name = f.firstName, f.last_name = f.lastName, a = f, n(f);
2322
+ onComplete(a, c, d) {
2323
+ let u = {};
2324
+ const p = String(a).replace(/'/g, '"');
2325
+ Object.keys(p).forEach((f) => {
2326
+ p[f] === "firstName" && (u.first_name = p.firstName);
2327
+ }), u.first_name = u.firstName, u.last_name = u.lastName, console.log("_3DSwym_get_currentUser | info", u), r = u, n(u);
2327
2328
  },
2328
- onFailure(d) {
2329
- i("ERROR | _3DSwym_get_currentUser => _3DDashboard + /api/users/current", d);
2329
+ onFailure(a) {
2330
+ i("ERROR | _3DSwym_get_currentUser => _3DDashboard + /api/users/current", a);
2330
2331
  }
2331
2332
  });
2332
2333
  }
2333
- a ? n(a) : i("ERROR | _3DSwym_get_currentUser => CURRENT_USER is null");
2334
+ r ? n(r) : i("ERROR | _3DSwym_get_currentUser => CURRENT_USER is null");
2334
2335
  } catch (r) {
2335
2336
  i("ERROR | _3DSwym_get_currentUser => ", r);
2336
2337
  }