lexmount 0.5.9 → 0.5.10
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +34 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -851,6 +851,6 @@ declare class TimeoutError extends LexmountError {
|
|
|
851
851
|
/**
|
|
852
852
|
* Lexmount Node.js SDK.
|
|
853
853
|
*/
|
|
854
|
-
declare const VERSION = "0.5.
|
|
854
|
+
declare const VERSION = "0.5.10";
|
|
855
855
|
|
|
856
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
|
@@ -851,6 +851,6 @@ declare class TimeoutError extends LexmountError {
|
|
|
851
851
|
/**
|
|
852
852
|
* Lexmount Node.js SDK.
|
|
853
853
|
*/
|
|
854
|
-
declare const VERSION = "0.5.
|
|
854
|
+
declare const VERSION = "0.5.10";
|
|
855
855
|
|
|
856
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
|
@@ -318,6 +318,9 @@ function withRequestedRegion(client, payload) {
|
|
|
318
318
|
const regionId = client.selectedRegion ?? client.region;
|
|
319
319
|
return regionId ? { ...payload, region_id: regionId } : payload;
|
|
320
320
|
}
|
|
321
|
+
function projectHeaders(projectId) {
|
|
322
|
+
return projectId ? { headers: { "x-project-id": projectId } } : void 0;
|
|
323
|
+
}
|
|
321
324
|
function getNumber(value) {
|
|
322
325
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
323
326
|
}
|
|
@@ -462,10 +465,8 @@ var SessionDownloadsResource = class {
|
|
|
462
465
|
async list(sessionId, projectId) {
|
|
463
466
|
const response = await this.client._post(
|
|
464
467
|
`${this.client.baseUrl}/instance/v1/sessions/${sessionId}/downloads/list`,
|
|
465
|
-
{
|
|
466
|
-
|
|
467
|
-
project_id: projectId ?? this.client.projectId
|
|
468
|
-
}
|
|
468
|
+
{},
|
|
469
|
+
projectHeaders(projectId)
|
|
469
470
|
);
|
|
470
471
|
if (response.status >= 400) {
|
|
471
472
|
this.handleError("list session downloads", response, sessionId);
|
|
@@ -493,12 +494,10 @@ var SessionDownloadsResource = class {
|
|
|
493
494
|
async get(sessionId, downloadId, projectId) {
|
|
494
495
|
const response = await this.client._get(
|
|
495
496
|
`${this.client.baseUrl}/instance/v1/sessions/${sessionId}/downloads/${downloadId}`,
|
|
497
|
+
void 0,
|
|
496
498
|
{
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
responseType: "arraybuffer"
|
|
499
|
+
responseType: "arraybuffer",
|
|
500
|
+
...projectHeaders(projectId) ?? {}
|
|
502
501
|
}
|
|
503
502
|
);
|
|
504
503
|
if (response.status >= 400) {
|
|
@@ -509,12 +508,10 @@ var SessionDownloadsResource = class {
|
|
|
509
508
|
async archive(sessionId, projectId) {
|
|
510
509
|
const response = await this.client._get(
|
|
511
510
|
`${this.client.baseUrl}/instance/v1/sessions/${sessionId}/downloads/archive`,
|
|
511
|
+
void 0,
|
|
512
512
|
{
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
responseType: "arraybuffer"
|
|
513
|
+
responseType: "arraybuffer",
|
|
514
|
+
...projectHeaders(projectId) ?? {}
|
|
518
515
|
}
|
|
519
516
|
);
|
|
520
517
|
if (response.status >= 400) {
|
|
@@ -525,10 +522,8 @@ var SessionDownloadsResource = class {
|
|
|
525
522
|
async delete(sessionId, projectId) {
|
|
526
523
|
const response = await this.client._delete(
|
|
527
524
|
`${this.client.baseUrl}/instance/v1/sessions/${sessionId}/downloads`,
|
|
528
|
-
{
|
|
529
|
-
|
|
530
|
-
project_id: projectId ?? this.client.projectId
|
|
531
|
-
}
|
|
525
|
+
{},
|
|
526
|
+
projectHeaders(projectId)
|
|
532
527
|
);
|
|
533
528
|
if (response.status >= 400) {
|
|
534
529
|
this.handleError("delete session downloads", response, sessionId);
|
|
@@ -566,8 +561,6 @@ var SessionsResource = class {
|
|
|
566
561
|
*/
|
|
567
562
|
async create(options = {}) {
|
|
568
563
|
const payload = {
|
|
569
|
-
api_key: this.client.apiKey,
|
|
570
|
-
project_id: options.projectId ?? this.client.projectId,
|
|
571
564
|
browser_mode: options.browserMode ?? "normal"
|
|
572
565
|
};
|
|
573
566
|
if (options.customImageId) {
|
|
@@ -602,7 +595,11 @@ var SessionsResource = class {
|
|
|
602
595
|
return this.createAsync(withRequestedRegion(this.client, payload), options);
|
|
603
596
|
}
|
|
604
597
|
const url = `${this.client.baseUrl}/instance`;
|
|
605
|
-
const response = await this.client._post(
|
|
598
|
+
const response = await this.client._post(
|
|
599
|
+
url,
|
|
600
|
+
withRequestedRegion(this.client, payload),
|
|
601
|
+
projectHeaders(options.projectId)
|
|
602
|
+
);
|
|
606
603
|
if (response.status >= 400) {
|
|
607
604
|
this.handleCreateError(response);
|
|
608
605
|
}
|
|
@@ -634,7 +631,11 @@ var SessionsResource = class {
|
|
|
634
631
|
});
|
|
635
632
|
}
|
|
636
633
|
async createAsync(payload, options) {
|
|
637
|
-
const response = await this.client._post(
|
|
634
|
+
const response = await this.client._post(
|
|
635
|
+
`${this.client.baseUrl}/instance/v2`,
|
|
636
|
+
payload,
|
|
637
|
+
projectHeaders(options.projectId)
|
|
638
|
+
);
|
|
638
639
|
if (response.status >= 400) {
|
|
639
640
|
this.handleCreateError(response);
|
|
640
641
|
}
|
|
@@ -696,10 +697,8 @@ var SessionsResource = class {
|
|
|
696
697
|
*/
|
|
697
698
|
async get(sessionId, projectId) {
|
|
698
699
|
const response = await this.client._post(`${this.client.baseUrl}/instance/session`, withRequestedRegion(this.client, {
|
|
699
|
-
api_key: this.client.apiKey,
|
|
700
|
-
project_id: projectId ?? this.client.projectId,
|
|
701
700
|
session_id: sessionId
|
|
702
|
-
}));
|
|
701
|
+
}), projectHeaders(projectId));
|
|
703
702
|
if (response.status >= 400) {
|
|
704
703
|
this.handleGetError(response, sessionId);
|
|
705
704
|
}
|
|
@@ -710,14 +709,15 @@ var SessionsResource = class {
|
|
|
710
709
|
*/
|
|
711
710
|
async list(options = {}) {
|
|
712
711
|
const url = `${this.client.baseUrl}/instance/v2/sessions`;
|
|
713
|
-
const payload = {
|
|
714
|
-
api_key: this.client.apiKey,
|
|
715
|
-
project_id: options.projectId ?? this.client.projectId
|
|
716
|
-
};
|
|
712
|
+
const payload = {};
|
|
717
713
|
if (options.status) {
|
|
718
714
|
payload.status = options.status;
|
|
719
715
|
}
|
|
720
|
-
const response = await this.client._post(
|
|
716
|
+
const response = await this.client._post(
|
|
717
|
+
url,
|
|
718
|
+
withRequestedRegion(this.client, payload),
|
|
719
|
+
projectHeaders(options.projectId)
|
|
720
|
+
);
|
|
721
721
|
if (response.status >= 400) {
|
|
722
722
|
this.handleListError(response);
|
|
723
723
|
}
|
|
@@ -744,11 +744,9 @@ var SessionsResource = class {
|
|
|
744
744
|
async delete(options) {
|
|
745
745
|
const url = `${this.client.baseUrl}/instance`;
|
|
746
746
|
const payload = withRequestedRegion(this.client, {
|
|
747
|
-
api_key: this.client.apiKey,
|
|
748
|
-
project_id: options.projectId ?? this.client.projectId,
|
|
749
747
|
session_id: options.sessionId
|
|
750
748
|
});
|
|
751
|
-
const response = await this.client._delete(url, payload);
|
|
749
|
+
const response = await this.client._delete(url, payload, projectHeaders(options.projectId));
|
|
752
750
|
if (response.status >= 400) {
|
|
753
751
|
this.handleDeleteError(response, options.sessionId);
|
|
754
752
|
}
|
|
@@ -1622,8 +1620,8 @@ var Lexmount = class {
|
|
|
1622
1620
|
logger2.debug(`${method} request to ${requestUrl}`);
|
|
1623
1621
|
try {
|
|
1624
1622
|
const headers = {
|
|
1625
|
-
|
|
1626
|
-
|
|
1623
|
+
"x-api-key": this.apiKey,
|
|
1624
|
+
"x-project-id": this.projectId,
|
|
1627
1625
|
...this.getDefaultHeaders(config2.data),
|
|
1628
1626
|
...config2.headers ?? {}
|
|
1629
1627
|
};
|
|
@@ -1769,7 +1767,7 @@ var Lexmount = class {
|
|
|
1769
1767
|
};
|
|
1770
1768
|
|
|
1771
1769
|
// src/index.ts
|
|
1772
|
-
var VERSION = "0.5.
|
|
1770
|
+
var VERSION = "0.5.10";
|
|
1773
1771
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1774
1772
|
0 && (module.exports = {
|
|
1775
1773
|
APIError,
|