lexmount 0.2.2 → 0.2.4

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
  */
@@ -275,7 +399,6 @@ interface SessionInfoOptions {
275
399
  createdAt: string;
276
400
  inspectUrl: string;
277
401
  containerId: string | null;
278
- inspectUrlDbg?: string;
279
402
  ws?: string | null;
280
403
  client?: Lexmount;
281
404
  }
@@ -292,7 +415,6 @@ declare class SessionInfo {
292
415
  readonly createdAt: string;
293
416
  readonly inspectUrl: string;
294
417
  readonly containerId: string | null;
295
- readonly inspectUrlDbg?: string;
296
418
  readonly ws: string | null;
297
419
  private readonly client?;
298
420
  private closed;
@@ -327,6 +449,47 @@ declare class SessionListResponse implements Iterable<SessionInfo> {
327
449
  [Symbol.iterator](): Iterator<SessionInfo>;
328
450
  at(index: number): SessionInfo | undefined;
329
451
  }
452
+ /**
453
+ * Session download metadata returned by the API.
454
+ */
455
+ declare class SessionDownloadInfo implements SessionDownloadInfoShape {
456
+ readonly id: string;
457
+ readonly filename: string;
458
+ readonly contentType: string | null;
459
+ readonly size: number;
460
+ readonly sha256: string | null;
461
+ readonly status: string;
462
+ readonly createdAt: string;
463
+ constructor(shape: SessionDownloadInfoShape);
464
+ }
465
+ /**
466
+ * Structured response from `sessions.downloads.list()`.
467
+ */
468
+ declare class SessionDownloadsListResponse {
469
+ readonly downloads: SessionDownloadInfo[];
470
+ readonly summary: SessionDownloadsListResponseShape;
471
+ constructor(downloads: SessionDownloadInfo[], summary: SessionDownloadsListResponseShape);
472
+ }
473
+ /**
474
+ * Structured response from `sessions.downloads.delete()`.
475
+ */
476
+ declare class SessionDownloadsDeleteResponse implements SessionDownloadsDeleteResponseShape {
477
+ readonly status: string;
478
+ readonly deletedCount: number;
479
+ constructor(shape: SessionDownloadsDeleteResponseShape);
480
+ }
481
+ /**
482
+ * Session download operations.
483
+ */
484
+ declare class SessionDownloadsResource {
485
+ private readonly client;
486
+ constructor(client: Lexmount);
487
+ list(sessionId: string, projectId?: string): Promise<SessionDownloadsListResponse>;
488
+ get(sessionId: string, downloadId: string, projectId?: string): Promise<Buffer>;
489
+ archive(sessionId: string, projectId?: string): Promise<Buffer>;
490
+ delete(sessionId: string, projectId?: string): Promise<SessionDownloadsDeleteResponse>;
491
+ private handleError;
492
+ }
330
493
  /**
331
494
  * Alias kept for parity with the Python SDK.
332
495
  */
@@ -336,6 +499,7 @@ type SessionCreateResponse = SessionInfo;
336
499
  */
337
500
  declare class SessionsResource {
338
501
  private readonly client;
502
+ readonly downloads: SessionDownloadsResource;
339
503
  constructor(client: Lexmount);
340
504
  /**
341
505
  * Create a new browser session.
@@ -355,6 +519,7 @@ declare class SessionsResource {
355
519
  * @internal
356
520
  */
357
521
  _getWebSocketDebuggerUrl(sessionId: string): Promise<string | null>;
522
+ private normalizeProxy;
358
523
  private handleCreateError;
359
524
  private handleListError;
360
525
  private handleDeleteError;
@@ -388,6 +553,10 @@ declare class Lexmount {
388
553
  * Persistent context operations.
389
554
  */
390
555
  readonly contexts: ContextsResource;
556
+ /**
557
+ * Browser extension operations.
558
+ */
559
+ readonly extensions: ExtensionsResource;
391
560
  private readonly httpClient;
392
561
  constructor(config?: LexmountConfig);
393
562
  /**
@@ -395,19 +564,19 @@ declare class Lexmount {
395
564
  *
396
565
  * @internal
397
566
  */
398
- _post<T = unknown>(url: string, data: Record<string, unknown>): Promise<AxiosResponse<T>>;
567
+ _post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
399
568
  /**
400
569
  * Internal GET request helper with timeout and network error mapping.
401
570
  *
402
571
  * @internal
403
572
  */
404
- _get<T = unknown>(url: string, params: Record<string, unknown>): Promise<AxiosResponse<T>>;
573
+ _get<T = unknown>(url: string, params?: Record<string, unknown>, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
405
574
  /**
406
575
  * Internal DELETE request helper with timeout and network error mapping.
407
576
  *
408
577
  * @internal
409
578
  */
410
- _delete<T = unknown>(url: string, data: Record<string, unknown>): Promise<AxiosResponse<T>>;
579
+ _delete<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<AxiosResponse<T>>;
411
580
  /**
412
581
  * Close the client.
413
582
  *
@@ -420,6 +589,7 @@ declare class Lexmount {
420
589
  toString(): string;
421
590
  private request;
422
591
  private normalizeRequestError;
592
+ private getDefaultHeaders;
423
593
  }
424
594
 
425
595
  /**
@@ -487,6 +657,6 @@ declare class TimeoutError extends LexmountError {
487
657
  /**
488
658
  * Lexmount Node.js SDK.
489
659
  */
490
- declare const VERSION = "0.2.0";
660
+ declare const VERSION = "0.2.4";
491
661
 
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 };
662
+ 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 };