@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 CHANGED
@@ -714,16 +714,11 @@ var LingoDotDevEngine = (_class = class {
714
714
  }
715
715
  }
716
716
  async whoami(signal) {
717
- if (this.isVNext) {
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(`${this.config.apiUrl}/whoami`, {
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
- if (this.isVNext) {
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(`${this.config.apiUrl}/whoami`, {
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingo.dev/_sdk",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Lingo.dev JS SDK",
5
5
  "private": false,
6
6
  "repository": {