@kedaruma/revlm-client 1.0.15 → 1.0.23
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/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -1
- package/dist/index.mjs +10 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -386,9 +386,18 @@ var App = class {
|
|
|
386
386
|
throw new Error("Unsupported credentials type");
|
|
387
387
|
}
|
|
388
388
|
const res = await this.__revlm.login(cred.email, cred.password);
|
|
389
|
+
console.log("### App:login res:", res);
|
|
389
390
|
if (!res || !res.ok || !res.token) {
|
|
390
391
|
const errMsg = res && !res.ok ? res.error : "login failed";
|
|
391
|
-
|
|
392
|
+
const err = new Error(errMsg);
|
|
393
|
+
const anyRes = res;
|
|
394
|
+
if (anyRes && typeof anyRes === "object") {
|
|
395
|
+
if (anyRes.code !== void 0) err.code = anyRes.code;
|
|
396
|
+
if (anyRes.status !== void 0) err.status = anyRes.status;
|
|
397
|
+
if (anyRes.reason !== void 0) err.reason = anyRes.reason;
|
|
398
|
+
err.response = anyRes;
|
|
399
|
+
}
|
|
400
|
+
throw err;
|
|
392
401
|
}
|
|
393
402
|
this.__revlm.setToken(res.token);
|
|
394
403
|
const user = new User(this, res.token, res.user);
|
package/dist/index.mjs
CHANGED
|
@@ -341,9 +341,18 @@ var App = class {
|
|
|
341
341
|
throw new Error("Unsupported credentials type");
|
|
342
342
|
}
|
|
343
343
|
const res = await this.__revlm.login(cred.email, cred.password);
|
|
344
|
+
console.log("### App:login res:", res);
|
|
344
345
|
if (!res || !res.ok || !res.token) {
|
|
345
346
|
const errMsg = res && !res.ok ? res.error : "login failed";
|
|
346
|
-
|
|
347
|
+
const err = new Error(errMsg);
|
|
348
|
+
const anyRes = res;
|
|
349
|
+
if (anyRes && typeof anyRes === "object") {
|
|
350
|
+
if (anyRes.code !== void 0) err.code = anyRes.code;
|
|
351
|
+
if (anyRes.status !== void 0) err.status = anyRes.status;
|
|
352
|
+
if (anyRes.reason !== void 0) err.reason = anyRes.reason;
|
|
353
|
+
err.response = anyRes;
|
|
354
|
+
}
|
|
355
|
+
throw err;
|
|
347
356
|
}
|
|
348
357
|
this.__revlm.setToken(res.token);
|
|
349
358
|
const user = new User(this, res.token, res.user);
|