notte-sdk 1.10.0 → 1.10.1

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.js CHANGED
@@ -232,7 +232,7 @@ __export(index_exports, {
232
232
  module.exports = __toCommonJS(index_exports);
233
233
 
234
234
  // src/version.ts
235
- var SDK_VERSION = true ? "1.10.0" : "dev";
235
+ var SDK_VERSION = true ? "1.10.1" : "dev";
236
236
  var SDK_PACKAGE_NAME = true ? "notte-sdk" : "notte-sdk";
237
237
 
238
238
  // src/version-check.ts
@@ -2241,6 +2241,7 @@ var NotteManagedAuth = class {
2241
2241
  constructor(client2) {
2242
2242
  this.client = client2;
2243
2243
  }
2244
+ client;
2244
2245
  /** Run only the verifier; this does not submit login credentials. */
2245
2246
  async checkConnection(connectionId) {
2246
2247
  const response = await this.client.getClient().post({
@@ -2404,6 +2405,9 @@ function createResources(client2, getApiKey) {
2404
2405
  },
2405
2406
  /** sessionStart: /sessions/start. Returns the API response body. */
2406
2407
  start: async (body, requestOptions = {}) => {
2408
+ body = { ...body };
2409
+ if (body.record_session === true) delete body.record_session;
2410
+ if (body.log_session === true) delete body.log_session;
2407
2411
  const response = await sessionStart({ client: client2, throwOnError: true, signal: requestOptions.signal, headers: { ...requestOptions.headers }, body });
2408
2412
  return response.data;
2409
2413
  },
@@ -3445,6 +3449,8 @@ var Session = class {
3445
3449
  ...auth_retry !== void 0 ? { auth_retry } : {},
3446
3450
  ...request.auth_ids?.length ? { wait_for_authentication: false } : {}
3447
3451
  };
3452
+ if (body.record_session === true) delete body.record_session;
3453
+ if (body.log_session === true) delete body.log_session;
3448
3454
  const shouldWait = options.wait_for_authentication ?? wait_for_authentication ?? true;
3449
3455
  const maxRetries = this.client.getConfig().maxRetries ?? 0;
3450
3456
  const timeoutMs = this.client.getConfig().timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
@@ -3746,7 +3752,11 @@ var Session = class {
3746
3752
  if (!(error instanceof NotteAPIError) || error.statusCode !== 404) {
3747
3753
  throw error;
3748
3754
  }
3749
- if (this.isActive && (error.apiMessage ?? "").includes("still active")) {
3755
+ const waitingForClose = error.error.replay_status === "waiting_for_session";
3756
+ if (error.error.replay_status === "disabled" || error.error.retryable === false && !waitingForClose) {
3757
+ throw error;
3758
+ }
3759
+ if (this.isActive && this.sessionId === sessionId && (waitingForClose || (error.apiMessage ?? "").includes("still active"))) {
3750
3760
  throw new Error(`Session ${sessionId} is still active \u2014 close the session first to generate the replay.`, {
3751
3761
  cause: error
3752
3762
  });
@@ -5555,6 +5565,8 @@ var SessionFiles = class {
5555
5565
  this.client = client2;
5556
5566
  this.sessionId = sessionId;
5557
5567
  }
5568
+ client;
5569
+ sessionId;
5558
5570
  /**
5559
5571
  * Upload bytes as a session file. `filename` is what the browser sees when
5560
5572
  * the file is later attached to a page.
@@ -5659,6 +5671,7 @@ var RemoteFileStorage = class _RemoteFileStorage {
5659
5671
  this.client = client2;
5660
5672
  this._sessionId = sessionId ?? null;
5661
5673
  }
5674
+ client;
5662
5675
  _sessionId;
5663
5676
  /** Bind the storage to a session. Called by `Session.start()` when the storage was passed to the session. */
5664
5677
  setSessionId(sessionId) {