instavm 0.13.0 → 0.16.0

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.mjs CHANGED
@@ -1,5 +1,3 @@
1
- "use strict";
2
-
3
1
  // src/client/HTTPClient.ts
4
2
  import axios from "axios";
5
3
 
@@ -139,7 +137,7 @@ var HTTPClient = class {
139
137
  timeout: config.timeout,
140
138
  headers: {
141
139
  "Content-Type": "application/json",
142
- "User-Agent": "instavm-js-sdk/0.12.0"
140
+ "User-Agent": "instavm-js-sdk/0.16.0"
143
141
  }
144
142
  });
145
143
  this.setupInterceptors();
@@ -1986,7 +1984,9 @@ var InstaVM = class {
1986
1984
  }
1987
1985
  try {
1988
1986
  const response = await this.httpClient.get(
1989
- `/v1/sessions/usage/${targetSessionId}`
1987
+ `/v1/sessions/usage/${targetSessionId}`,
1988
+ void 0,
1989
+ { "X-API-Key": this.httpClient.apiKey }
1990
1990
  );
1991
1991
  return {
1992
1992
  sessionsUsed: response.sessions_used || 0,
@@ -2002,6 +2002,32 @@ var InstaVM = class {
2002
2002
  );
2003
2003
  }
2004
2004
  }
2005
+ /**
2006
+ * Get the current user profile.
2007
+ */
2008
+ async getCurrentUser() {
2009
+ this.ensureNotLocal("User profile lookup");
2010
+ return this.httpClient.get(
2011
+ "/v1/users/me",
2012
+ void 0,
2013
+ { "X-API-Key": this.httpClient.apiKey }
2014
+ );
2015
+ }
2016
+ /**
2017
+ * Get the current status of a session.
2018
+ */
2019
+ async getSessionStatus(sessionId) {
2020
+ this.ensureNotLocal("Session management");
2021
+ const targetSessionId = sessionId || this._sessionId;
2022
+ if (!targetSessionId) {
2023
+ throw new SessionError("Session ID not set. Please create a session first.");
2024
+ }
2025
+ return this.httpClient.get(
2026
+ `/v1/sessions/status/${targetSessionId}`,
2027
+ void 0,
2028
+ { "X-API-Key": this.httpClient.apiKey }
2029
+ );
2030
+ }
2005
2031
  /**
2006
2032
  * Download a file from the remote VM
2007
2033
  */