lexmount 0.5.7 → 0.5.9

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 CHANGED
@@ -165,6 +165,10 @@ interface SessionCreateOptions {
165
165
  * Optional custom browser image identifier to use for this session.
166
166
  */
167
167
  customImageId?: string;
168
+ /**
169
+ * Optional ACE browser window size. Format: "width,height", for example "1920,1080".
170
+ */
171
+ windowSize?: string;
168
172
  /**
169
173
  * Optional persistent context configuration.
170
174
  */
@@ -705,6 +709,7 @@ declare class SessionsResource {
705
709
  */
706
710
  _getWebSocketDebuggerUrl(sessionId: string): Promise<string | null>;
707
711
  private normalizeProxy;
712
+ private normalizeWindowSize;
708
713
  private handleAsyncCreateFailed;
709
714
  private handleCreateError;
710
715
  private handleGetError;
@@ -764,6 +769,10 @@ type IntegratedAuthCallbackResult = {
764
769
  cancel: true;
765
770
  } | {
766
771
  cancel: false;
772
+ skip: true;
773
+ } | {
774
+ cancel: false;
775
+ skip?: false;
767
776
  scheme: string;
768
777
  token: string;
769
778
  };
@@ -842,6 +851,6 @@ declare class TimeoutError extends LexmountError {
842
851
  /**
843
852
  * Lexmount Node.js SDK.
844
853
  */
845
- declare const VERSION = "0.5.7";
854
+ declare const VERSION = "0.5.9";
846
855
 
847
856
  export { APIError, AuthenticationError, type BrowserMode, CDPClient, type CDPEventMessage, type CatalogInfo, type ContextAccessMode, type ContextCreateOptions, ContextInfo, type ContextListOptions, ContextListResponse, ContextLockedError, type ContextMetadata, ContextNotFoundError, type ContextStatus, ContextsResource, ExtensionInfo, type ExtensionInfoShape, type ExtensionListOptions, type ExtensionUploadOptions, ExtensionsResource, type ForceReleaseResponse, type IntegratedAuthCallback, type IntegratedAuthCallbackResult, Lexmount, type LexmountConfig, LexmountError, LexmountLogger, type LogLevel, NetworkError, PaginationInfo, type PaginationInfoShape, type RegionCatalogEntry, type RegionInfo, type SessionContext, type SessionCreateOptions, type SessionCreateResponse, type SessionDeleteOptions, SessionDownloadInfo, type SessionDownloadInfoShape, SessionDownloadsDeleteResponse, type SessionDownloadsDeleteResponseShape, SessionDownloadsListResponse, type SessionDownloadsListResponseShape, SessionDownloadsResource, SessionInfo, type SessionListOptions, SessionListResponse, SessionNotFoundError, type SessionProxyConfig, type SessionStatus, SessionTargetInfo, type SessionTargetInfoShape, SessionsResource, TimeoutError, VERSION, ValidationError, connectOverCDP, Lexmount as default, deregisterIntegratedAuthCallback, disableLogging, enableLogging, getLogger, registerIntegratedAuthCallback, setLogLevel };
package/dist/index.d.ts CHANGED
@@ -165,6 +165,10 @@ interface SessionCreateOptions {
165
165
  * Optional custom browser image identifier to use for this session.
166
166
  */
167
167
  customImageId?: string;
168
+ /**
169
+ * Optional ACE browser window size. Format: "width,height", for example "1920,1080".
170
+ */
171
+ windowSize?: string;
168
172
  /**
169
173
  * Optional persistent context configuration.
170
174
  */
@@ -705,6 +709,7 @@ declare class SessionsResource {
705
709
  */
706
710
  _getWebSocketDebuggerUrl(sessionId: string): Promise<string | null>;
707
711
  private normalizeProxy;
712
+ private normalizeWindowSize;
708
713
  private handleAsyncCreateFailed;
709
714
  private handleCreateError;
710
715
  private handleGetError;
@@ -764,6 +769,10 @@ type IntegratedAuthCallbackResult = {
764
769
  cancel: true;
765
770
  } | {
766
771
  cancel: false;
772
+ skip: true;
773
+ } | {
774
+ cancel: false;
775
+ skip?: false;
767
776
  scheme: string;
768
777
  token: string;
769
778
  };
@@ -842,6 +851,6 @@ declare class TimeoutError extends LexmountError {
842
851
  /**
843
852
  * Lexmount Node.js SDK.
844
853
  */
845
- declare const VERSION = "0.5.7";
854
+ declare const VERSION = "0.5.9";
846
855
 
847
856
  export { APIError, AuthenticationError, type BrowserMode, CDPClient, type CDPEventMessage, type CatalogInfo, type ContextAccessMode, type ContextCreateOptions, ContextInfo, type ContextListOptions, ContextListResponse, ContextLockedError, type ContextMetadata, ContextNotFoundError, type ContextStatus, ContextsResource, ExtensionInfo, type ExtensionInfoShape, type ExtensionListOptions, type ExtensionUploadOptions, ExtensionsResource, type ForceReleaseResponse, type IntegratedAuthCallback, type IntegratedAuthCallbackResult, Lexmount, type LexmountConfig, LexmountError, LexmountLogger, type LogLevel, NetworkError, PaginationInfo, type PaginationInfoShape, type RegionCatalogEntry, type RegionInfo, type SessionContext, type SessionCreateOptions, type SessionCreateResponse, type SessionDeleteOptions, SessionDownloadInfo, type SessionDownloadInfoShape, SessionDownloadsDeleteResponse, type SessionDownloadsDeleteResponseShape, SessionDownloadsListResponse, type SessionDownloadsListResponseShape, SessionDownloadsResource, SessionInfo, type SessionListOptions, SessionListResponse, SessionNotFoundError, type SessionProxyConfig, type SessionStatus, SessionTargetInfo, type SessionTargetInfoShape, SessionsResource, TimeoutError, VERSION, ValidationError, connectOverCDP, Lexmount as default, deregisterIntegratedAuthCallback, disableLogging, enableLogging, getLogger, registerIntegratedAuthCallback, setLogLevel };
package/dist/index.js CHANGED
@@ -573,6 +573,10 @@ var SessionsResource = class {
573
573
  if (options.customImageId) {
574
574
  payload.custom_image_id = options.customImageId;
575
575
  }
576
+ const windowSize = this.normalizeWindowSize(options.windowSize);
577
+ if (windowSize) {
578
+ payload.window_size = windowSize;
579
+ }
576
580
  if (options.context) {
577
581
  const contextPayload = {
578
582
  id: options.context.id,
@@ -800,6 +804,20 @@ var SessionsResource = class {
800
804
  }
801
805
  return normalizedProxy;
802
806
  }
807
+ normalizeWindowSize(windowSize) {
808
+ if (!windowSize) {
809
+ return void 0;
810
+ }
811
+ const normalized = windowSize.trim();
812
+ if (!normalized) {
813
+ return void 0;
814
+ }
815
+ const match = normalized.match(/^(\d+),(\d+)$/);
816
+ if (!match || Number(match[1]) <= 0 || Number(match[2]) <= 0) {
817
+ throw new ValidationError("windowSize must use width,height format, for example 1920,1080");
818
+ }
819
+ return normalized;
820
+ }
803
821
  handleAsyncCreateFailed(payload) {
804
822
  const context = asRecord(payload.context);
805
823
  const contextId = getString(context.id);
@@ -1016,6 +1034,19 @@ async function registerIntegratedAuthCallback(sessionOrClient, callback) {
1016
1034
  );
1017
1035
  return;
1018
1036
  }
1037
+ if (result.skip) {
1038
+ await client.send(
1039
+ "Fetch.continueWithIntegratedAuth",
1040
+ {
1041
+ requestId: params.requestId,
1042
+ authChallengeResponse: {
1043
+ response: "SkipAuth"
1044
+ }
1045
+ },
1046
+ sessionId
1047
+ );
1048
+ return;
1049
+ }
1019
1050
  await client.send(
1020
1051
  "Fetch.continueWithIntegratedAuth",
1021
1052
  {
@@ -1738,7 +1769,7 @@ var Lexmount = class {
1738
1769
  };
1739
1770
 
1740
1771
  // src/index.ts
1741
- var VERSION = "0.5.7";
1772
+ var VERSION = "0.5.9";
1742
1773
  // Annotate the CommonJS export names for ESM import in node:
1743
1774
  0 && (module.exports = {
1744
1775
  APIError,