@lingo.dev/_sdk 0.15.2 → 0.15.3
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/build/index.cjs +4 -9
- package/build/index.mjs +4 -9
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -714,16 +714,11 @@ var LingoDotDevEngine = (_class = class {
|
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
async whoami(signal) {
|
|
717
|
-
|
|
718
|
-
return { email: "vnext-user", id: this.config.engineId };
|
|
719
|
-
}
|
|
717
|
+
const url = this.isVNext ? `${this.config.apiUrl}/users/me` : `${this.config.apiUrl}/whoami`;
|
|
720
718
|
try {
|
|
721
|
-
const res = await fetch(
|
|
722
|
-
method: "POST",
|
|
723
|
-
headers:
|
|
724
|
-
Authorization: `Bearer ${this.config.apiKey}`,
|
|
725
|
-
"Content-Type": "application/json"
|
|
726
|
-
},
|
|
719
|
+
const res = await fetch(url, {
|
|
720
|
+
method: this.isVNext ? "GET" : "POST",
|
|
721
|
+
headers: this.headers,
|
|
727
722
|
signal
|
|
728
723
|
});
|
|
729
724
|
if (res.ok) {
|
package/build/index.mjs
CHANGED
|
@@ -714,16 +714,11 @@ var LingoDotDevEngine = class {
|
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
async whoami(signal) {
|
|
717
|
-
|
|
718
|
-
return { email: "vnext-user", id: this.config.engineId };
|
|
719
|
-
}
|
|
717
|
+
const url = this.isVNext ? `${this.config.apiUrl}/users/me` : `${this.config.apiUrl}/whoami`;
|
|
720
718
|
try {
|
|
721
|
-
const res = await fetch(
|
|
722
|
-
method: "POST",
|
|
723
|
-
headers:
|
|
724
|
-
Authorization: `Bearer ${this.config.apiKey}`,
|
|
725
|
-
"Content-Type": "application/json"
|
|
726
|
-
},
|
|
719
|
+
const res = await fetch(url, {
|
|
720
|
+
method: this.isVNext ? "GET" : "POST",
|
|
721
|
+
headers: this.headers,
|
|
727
722
|
signal
|
|
728
723
|
});
|
|
729
724
|
if (res.ok) {
|