lexmount 0.2.0 → 0.2.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AxiosResponse } from 'axios';
1
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
2
 
3
3
  /**
4
4
  * Supported SDK log levels.
@@ -67,6 +67,27 @@ interface SessionContext {
67
67
  */
68
68
  mode: ContextAccessMode;
69
69
  }
70
+ /**
71
+ * Upstream proxy configuration for a session.
72
+ */
73
+ interface SessionProxyConfig {
74
+ /**
75
+ * Proxy type. Currently `external` is supported by the API.
76
+ */
77
+ type?: 'external' | string;
78
+ /**
79
+ * Upstream proxy server URL.
80
+ */
81
+ server: string;
82
+ /**
83
+ * Optional upstream proxy username.
84
+ */
85
+ username?: string;
86
+ /**
87
+ * Optional upstream proxy password.
88
+ */
89
+ password?: string;
90
+ }
70
91
  /**
71
92
  * SDK client configuration.
72
93
  */
@@ -112,6 +133,14 @@ interface SessionCreateOptions {
112
133
  * Optional persistent context configuration.
113
134
  */
114
135
  context?: SessionContext;
136
+ /**
137
+ * Optional uploaded browser extension identifiers to mount.
138
+ */
139
+ extensionIds?: string[];
140
+ /**
141
+ * Optional upstream proxy configuration.
142
+ */
143
+ proxy?: SessionProxyConfig;
115
144
  }
116
145
  /**
117
146
  * Session list options.
@@ -174,6 +203,72 @@ interface ForceReleaseResponse {
174
203
  status: string;
175
204
  message: string;
176
205
  }
206
+ /**
207
+ * Extension metadata returned by the API.
208
+ */
209
+ interface ExtensionInfoShape {
210
+ id: string;
211
+ name: string;
212
+ projectId: string;
213
+ createdAt?: string;
214
+ updatedAt?: string;
215
+ }
216
+ /**
217
+ * Extension upload options.
218
+ */
219
+ interface ExtensionUploadOptions {
220
+ /**
221
+ * Optional display name for the uploaded extension.
222
+ */
223
+ name?: string;
224
+ /**
225
+ * Override the default project identifier.
226
+ */
227
+ projectId?: string;
228
+ }
229
+ /**
230
+ * Extension list options.
231
+ */
232
+ interface ExtensionListOptions {
233
+ /**
234
+ * Override the default project identifier.
235
+ */
236
+ projectId?: string;
237
+ /**
238
+ * Maximum number of extensions to return.
239
+ */
240
+ limit?: number;
241
+ /**
242
+ * Number of extensions to skip.
243
+ */
244
+ offset?: number;
245
+ }
246
+ /**
247
+ * Session download metadata returned by the API.
248
+ */
249
+ interface SessionDownloadInfoShape {
250
+ id: string;
251
+ filename: string;
252
+ contentType: string | null;
253
+ size: number;
254
+ sha256: string | null;
255
+ status: string;
256
+ createdAt: string;
257
+ }
258
+ /**
259
+ * Structured response from session download listing.
260
+ */
261
+ interface SessionDownloadsListResponseShape {
262
+ count: number;
263
+ totalSize: number;
264
+ }
265
+ /**
266
+ * Structured response from session download deletion.
267
+ */
268
+ interface SessionDownloadsDeleteResponseShape {
269
+ status: string;
270
+ deletedCount: number;
271
+ }
177
272
  /**
178
273
  * Session pagination metadata.
179
274
  */
@@ -250,6 +345,35 @@ declare class ContextsResource {
250
345
  private handleError;
251
346
  }
252
347
 
348
+ /**
349
+ * Extension resource implementation.
350
+ */
351
+
352
+ /**
353
+ * Extension metadata returned by the API.
354
+ */
355
+ declare class ExtensionInfo implements ExtensionInfoShape {
356
+ readonly id: string;
357
+ readonly name: string;
358
+ readonly projectId: string;
359
+ readonly createdAt?: string;
360
+ readonly updatedAt?: string;
361
+ constructor(shape: ExtensionInfoShape);
362
+ }
363
+ /**
364
+ * Browser extension resource operations.
365
+ */
366
+ declare class ExtensionsResource {
367
+ private readonly client;
368
+ constructor(client: Lexmount);
369
+ upload(filePath: string, options?: ExtensionUploadOptions): Promise<ExtensionInfo>;
370
+ list(options?: ExtensionListOptions): Promise<ExtensionInfo[]>;
371
+ get(extensionId: string, projectId?: string): Promise<ExtensionInfo>;
372
+ delete(extensionId: string): Promise<void>;
373
+ private parseInfo;
374
+ private handleError;
375
+ }
376
+
253
377
  /**
254
378
  * Session resource implementation.
255
379
  */
@@ -327,6 +451,47 @@ declare class SessionListResponse implements Iterable<SessionInfo> {
327
451
  [Symbol.iterator](): Iterator<SessionInfo>;
328
452
  at(index: number): SessionInfo | undefined;
329
453
  }
454
+ /**
455
+ * Session download metadata returned by the API.
456
+ */
457
+ declare class SessionDownloadInfo implements SessionDownloadInfoShape {
458
+ readonly id: string;
459
+ readonly filename: string;
460
+ readonly contentType: string | null;
461
+ readonly size: number;
462
+ readonly sha256: string | null;
463
+ readonly status: string;
464
+ readonly createdAt: string;
465
+ constructor(shape: SessionDownloadInfoShape);
466
+ }
467
+ /**
468
+ * Structured response from `sessions.downloads.list()`.
469
+ */
470
+ declare class SessionDownloadsListResponse {
471
+ readonly downloads: SessionDownloadInfo[];
472
+ readonly summary: SessionDownloadsListResponseShape;
473
+ constructor(downloads: SessionDownloadInfo[], summary: SessionDownloadsListResponseShape);
474
+ }
475
+ /**
476
+ * Structured response from `sessions.downloads.delete()`.
477
+ */
478
+ declare class SessionDownloadsDeleteResponse implements SessionDownloadsDeleteResponseShape {
479
+ readonly status: string;
480
+ readonly deletedCount: number;
481
+ constructor(shape: SessionDownloadsDeleteResponseShape);
482
+ }
483
+ /**
484
+ * Session download operations.
485
+ */
486
+ declare class SessionDownloadsResource {
487
+ private readonly client;
488
+ constructor(client: Lexmount);
489
+ list(sessionId: string, projectId?: string): Promise<SessionDownloadsListResponse>;
490
+ get(sessionId: string, downloadId: string, projectId?: string): Promise<Buffer>;
491
+ archive(sessionId: string, projectId?: string): Promise<Buffer>;
492
+ delete(sessionId: string, projectId?: string): Promise<SessionDownloadsDeleteResponse>;
493
+ private handleError;
494
+ }
330
495
  /**
331
496
  * Alias kept for parity with the Python SDK.
332
497
  */
@@ -336,6 +501,7 @@ type SessionCreateResponse = SessionInfo;
336
501
  */
337
502
  declare class SessionsResource {
338
503
  private readonly client;
504
+ readonly downloads: SessionDownloadsResource;
339
505
  constructor(client: Lexmount);
340
506
  /**
341
507
  * Create a new browser session.
@@ -355,6 +521,7 @@ declare class SessionsResource {
355
521
  * @internal
356
522
  */
357
523
  _getWebSocketDebuggerUrl(sessionId: string): Promise<string | null>;
524
+ private normalizeProxy;
358
525
  private handleCreateError;
359
526
  private handleListError;
360
527
  private handleDeleteError;
@@ -388,6 +555,10 @@ declare class Lexmount {
388
555
  * Persistent context operations.
389
556
  */
390
557
  readonly contexts: ContextsResource;
558
+ /**
559
+ * Browser extension operations.
560
+ */
561
+ readonly extensions: ExtensionsResource;
391
562
  private readonly httpClient;
392
563
  constructor(config?: LexmountConfig);
393
564
  /**
@@ -395,19 +566,19 @@ declare class Lexmount {
395
566
  *
396
567
  * @internal
397
568
  */
398
- _post<T = unknown>(url: string, data: Record<string, unknown>): Promise<AxiosResponse<T>>;
569
+ _post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
399
570
  /**
400
571
  * Internal GET request helper with timeout and network error mapping.
401
572
  *
402
573
  * @internal
403
574
  */
404
- _get<T = unknown>(url: string, params: Record<string, unknown>): Promise<AxiosResponse<T>>;
575
+ _get<T = unknown>(url: string, params?: Record<string, unknown>, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
405
576
  /**
406
577
  * Internal DELETE request helper with timeout and network error mapping.
407
578
  *
408
579
  * @internal
409
580
  */
410
- _delete<T = unknown>(url: string, data: Record<string, unknown>): Promise<AxiosResponse<T>>;
581
+ _delete<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
411
582
  /**
412
583
  * Close the client.
413
584
  *
@@ -420,6 +591,7 @@ declare class Lexmount {
420
591
  toString(): string;
421
592
  private request;
422
593
  private normalizeRequestError;
594
+ private getDefaultHeaders;
423
595
  }
424
596
 
425
597
  /**
@@ -489,4 +661,4 @@ declare class TimeoutError extends LexmountError {
489
661
  */
490
662
  declare const VERSION = "0.2.0";
491
663
 
492
- export { APIError, AuthenticationError, type BrowserMode, type ContextAccessMode, type ContextCreateOptions, ContextInfo, type ContextListOptions, ContextListResponse, ContextLockedError, type ContextMetadata, ContextNotFoundError, type ContextStatus, ContextsResource, type ForceReleaseResponse, Lexmount, type LexmountConfig, LexmountError, LexmountLogger, type LogLevel, NetworkError, PaginationInfo, type PaginationInfoShape, type SessionContext, type SessionCreateOptions, type SessionCreateResponse, type SessionDeleteOptions, SessionInfo, type SessionListOptions, SessionListResponse, SessionNotFoundError, type SessionStatus, SessionsResource, TimeoutError, VERSION, ValidationError, Lexmount as default, disableLogging, enableLogging, getLogger, setLogLevel };
664
+ export { APIError, AuthenticationError, type BrowserMode, 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, Lexmount, type LexmountConfig, LexmountError, LexmountLogger, type LogLevel, NetworkError, PaginationInfo, type PaginationInfoShape, 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, SessionsResource, TimeoutError, VERSION, ValidationError, Lexmount as default, disableLogging, enableLogging, getLogger, setLogLevel };