@scalebrowser/sdk 0.2.0 → 0.3.0
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.cjs +7 -6
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -209,11 +209,12 @@ function enc(id) {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
// src/client-control.ts
|
|
212
|
-
var
|
|
212
|
+
var NO_ACCOUNT = {
|
|
213
213
|
licensed: false,
|
|
214
|
+
signed_in: false,
|
|
214
215
|
running_local: 0,
|
|
215
216
|
profiles_local: 0,
|
|
216
|
-
permits_launch:
|
|
217
|
+
permits_launch: false
|
|
217
218
|
};
|
|
218
219
|
var ControlApi = class extends ClientCore {
|
|
219
220
|
// ── Interruptions ──────────────────────────────────────────────────────────
|
|
@@ -263,14 +264,14 @@ var ControlApi = class extends ClientCore {
|
|
|
263
264
|
* Licence state for display. The launch gate stays the authority on starts.
|
|
264
265
|
*
|
|
265
266
|
* A daemon predating the route answers 404, and that is not an error worth
|
|
266
|
-
* throwing
|
|
267
|
-
*
|
|
267
|
+
* throwing — but it is read pessimistically: nothing can be shown to be
|
|
268
|
+
* connected or permitted. Same shape of tolerance as {@link getMetrics}.
|
|
268
269
|
*/
|
|
269
270
|
async getAccount(signal) {
|
|
270
271
|
try {
|
|
271
272
|
return await this.request("GET", "/v1/account", void 0, { signal });
|
|
272
273
|
} catch (err) {
|
|
273
|
-
if (err instanceof ApiError && err.status === 404) return { ...
|
|
274
|
+
if (err instanceof ApiError && err.status === 404) return { ...NO_ACCOUNT };
|
|
274
275
|
throw err;
|
|
275
276
|
}
|
|
276
277
|
}
|
|
@@ -1240,7 +1241,7 @@ var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
|
1240
1241
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1241
1242
|
|
|
1242
1243
|
// src/index.ts
|
|
1243
|
-
var VERSION = "0.
|
|
1244
|
+
var VERSION = "0.3.0";
|
|
1244
1245
|
|
|
1245
1246
|
exports.ApiError = ApiError;
|
|
1246
1247
|
exports.CdpError = CdpError;
|
package/dist/index.d.cts
CHANGED
|
@@ -672,8 +672,13 @@ interface ArtifactBytes {
|
|
|
672
672
|
* the launch gate refuses is worse than no light.
|
|
673
673
|
*/
|
|
674
674
|
interface Account {
|
|
675
|
-
/**
|
|
675
|
+
/** Whether an entitlement snapshot has arrived. Also `false` in the seconds
|
|
676
|
+
* between signing in and the first refresh, so it never answers "is this
|
|
677
|
+
* machine connected to an account" — `signed_in` does. */
|
|
676
678
|
licensed: boolean;
|
|
679
|
+
/** Whether an account is connected to this machine. One without an account
|
|
680
|
+
* starts no browser (DEC-014). */
|
|
681
|
+
signed_in: boolean;
|
|
677
682
|
plan?: string;
|
|
678
683
|
status?: string;
|
|
679
684
|
/**
|
|
@@ -763,8 +768,8 @@ declare class ControlApi extends ClientCore {
|
|
|
763
768
|
* Licence state for display. The launch gate stays the authority on starts.
|
|
764
769
|
*
|
|
765
770
|
* A daemon predating the route answers 404, and that is not an error worth
|
|
766
|
-
* throwing
|
|
767
|
-
*
|
|
771
|
+
* throwing — but it is read pessimistically: nothing can be shown to be
|
|
772
|
+
* connected or permitted. Same shape of tolerance as {@link getMetrics}.
|
|
768
773
|
*/
|
|
769
774
|
getAccount(signal?: AbortSignal): Promise<Account>;
|
|
770
775
|
/** "Is the daemon alive?" Public, needs no token. */
|
|
@@ -1608,6 +1613,6 @@ interface ScalebrowserClient extends IdentityApi, RunsApi, ControlApi, Extension
|
|
|
1608
1613
|
* ```
|
|
1609
1614
|
*/
|
|
1610
1615
|
|
|
1611
|
-
declare const VERSION = "0.
|
|
1616
|
+
declare const VERSION = "0.3.0";
|
|
1612
1617
|
|
|
1613
1618
|
export { type Account, type ActivitySnapshot, type AgentRun, ApiError, type ApiErrorBody, type ArtifactBytes, type ArtifactPutResult, type AttachOptions, type AuditDetectorReport, type AuditReport, type AuditStatus, type AuditVerdict, type BindInboxBody, type CdpConnectOptions, CdpError, type CdpEvent, CdpSession, type ClickOptions, type CreateGroupBody, type CreateInboxBody, type CreatePresetBody, DEFAULT_CAPACITY, type DeleteInterruptionRuleParams, type EffectiveInterruptionLock, ErrorCode, type ErrorCodeValue, type EvaluateOptions, type FetchLike, GEO_MODES, type GeoMode, type GoalSource, type Group, HOST_MODES, type HealthStatus, type HostMode, type Inbox, type InboxBinding, type InboxBindings, type InboxChannel, type InputClient, type InterruptionChoice, type InterruptionLock, type InterruptionLockRow, type InterruptionLockView, type InterruptionRuleRow, type LaunchHandle, type ListRunsParams, type ListStepsParams, type NavigateOptions, NetworkError, type OsFamily, type OutcomeSource, PROXY_KINDS, type PasskeyRow, type PersonaConstraintOptions, type Preset, type PresetConfig, type PresetConstraints, type Profile, type ProfileActivity, type ProtectionLevel, type ProtectionStatus, type Proxy, type ProxyKind, ROTATIONS, RUNTIME_STATES, type ReadyStatus, type RevealCookiesBody, type RevealCookiesResult, type RevealedCookie, type Rotation, type RunActor, type RunOutcome, type RunStep, type RuntimeState, ScalebrowserClient, type ScalebrowserClientOptions, ScalebrowserError, type ScrollOptions, type SessionExportBody, type SessionExportResult, type SessionImportBody, type SessionKind, type SetInterruptionLockBody, type SetInterruptionRuleBody, type StepKind, type StepTarget, type StreamHandlers, type StreamParams, type StreamStatus, type TrustedInputBody, type UpdateGroupBody, type UpdateInboxBody, type UpdatePresetBody, VERSION, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/dist/index.d.ts
CHANGED
|
@@ -672,8 +672,13 @@ interface ArtifactBytes {
|
|
|
672
672
|
* the launch gate refuses is worse than no light.
|
|
673
673
|
*/
|
|
674
674
|
interface Account {
|
|
675
|
-
/**
|
|
675
|
+
/** Whether an entitlement snapshot has arrived. Also `false` in the seconds
|
|
676
|
+
* between signing in and the first refresh, so it never answers "is this
|
|
677
|
+
* machine connected to an account" — `signed_in` does. */
|
|
676
678
|
licensed: boolean;
|
|
679
|
+
/** Whether an account is connected to this machine. One without an account
|
|
680
|
+
* starts no browser (DEC-014). */
|
|
681
|
+
signed_in: boolean;
|
|
677
682
|
plan?: string;
|
|
678
683
|
status?: string;
|
|
679
684
|
/**
|
|
@@ -763,8 +768,8 @@ declare class ControlApi extends ClientCore {
|
|
|
763
768
|
* Licence state for display. The launch gate stays the authority on starts.
|
|
764
769
|
*
|
|
765
770
|
* A daemon predating the route answers 404, and that is not an error worth
|
|
766
|
-
* throwing
|
|
767
|
-
*
|
|
771
|
+
* throwing — but it is read pessimistically: nothing can be shown to be
|
|
772
|
+
* connected or permitted. Same shape of tolerance as {@link getMetrics}.
|
|
768
773
|
*/
|
|
769
774
|
getAccount(signal?: AbortSignal): Promise<Account>;
|
|
770
775
|
/** "Is the daemon alive?" Public, needs no token. */
|
|
@@ -1608,6 +1613,6 @@ interface ScalebrowserClient extends IdentityApi, RunsApi, ControlApi, Extension
|
|
|
1608
1613
|
* ```
|
|
1609
1614
|
*/
|
|
1610
1615
|
|
|
1611
|
-
declare const VERSION = "0.
|
|
1616
|
+
declare const VERSION = "0.3.0";
|
|
1612
1617
|
|
|
1613
1618
|
export { type Account, type ActivitySnapshot, type AgentRun, ApiError, type ApiErrorBody, type ArtifactBytes, type ArtifactPutResult, type AttachOptions, type AuditDetectorReport, type AuditReport, type AuditStatus, type AuditVerdict, type BindInboxBody, type CdpConnectOptions, CdpError, type CdpEvent, CdpSession, type ClickOptions, type CreateGroupBody, type CreateInboxBody, type CreatePresetBody, DEFAULT_CAPACITY, type DeleteInterruptionRuleParams, type EffectiveInterruptionLock, ErrorCode, type ErrorCodeValue, type EvaluateOptions, type FetchLike, GEO_MODES, type GeoMode, type GoalSource, type Group, HOST_MODES, type HealthStatus, type HostMode, type Inbox, type InboxBinding, type InboxBindings, type InboxChannel, type InputClient, type InterruptionChoice, type InterruptionLock, type InterruptionLockRow, type InterruptionLockView, type InterruptionRuleRow, type LaunchHandle, type ListRunsParams, type ListStepsParams, type NavigateOptions, NetworkError, type OsFamily, type OutcomeSource, PROXY_KINDS, type PasskeyRow, type PersonaConstraintOptions, type Preset, type PresetConfig, type PresetConstraints, type Profile, type ProfileActivity, type ProtectionLevel, type ProtectionStatus, type Proxy, type ProxyKind, ROTATIONS, RUNTIME_STATES, type ReadyStatus, type RevealCookiesBody, type RevealCookiesResult, type RevealedCookie, type Rotation, type RunActor, type RunOutcome, type RunStep, type RuntimeState, ScalebrowserClient, type ScalebrowserClientOptions, ScalebrowserError, type ScrollOptions, type SessionExportBody, type SessionExportResult, type SessionImportBody, type SessionKind, type SetInterruptionLockBody, type SetInterruptionRuleBody, type StepKind, type StepTarget, type StreamHandlers, type StreamParams, type StreamStatus, type TrustedInputBody, type UpdateGroupBody, type UpdateInboxBody, type UpdatePresetBody, VERSION, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/dist/index.js
CHANGED
|
@@ -203,11 +203,12 @@ function enc(id) {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
// src/client-control.ts
|
|
206
|
-
var
|
|
206
|
+
var NO_ACCOUNT = {
|
|
207
207
|
licensed: false,
|
|
208
|
+
signed_in: false,
|
|
208
209
|
running_local: 0,
|
|
209
210
|
profiles_local: 0,
|
|
210
|
-
permits_launch:
|
|
211
|
+
permits_launch: false
|
|
211
212
|
};
|
|
212
213
|
var ControlApi = class extends ClientCore {
|
|
213
214
|
// ── Interruptions ──────────────────────────────────────────────────────────
|
|
@@ -257,14 +258,14 @@ var ControlApi = class extends ClientCore {
|
|
|
257
258
|
* Licence state for display. The launch gate stays the authority on starts.
|
|
258
259
|
*
|
|
259
260
|
* A daemon predating the route answers 404, and that is not an error worth
|
|
260
|
-
* throwing
|
|
261
|
-
*
|
|
261
|
+
* throwing — but it is read pessimistically: nothing can be shown to be
|
|
262
|
+
* connected or permitted. Same shape of tolerance as {@link getMetrics}.
|
|
262
263
|
*/
|
|
263
264
|
async getAccount(signal) {
|
|
264
265
|
try {
|
|
265
266
|
return await this.request("GET", "/v1/account", void 0, { signal });
|
|
266
267
|
} catch (err) {
|
|
267
|
-
if (err instanceof ApiError && err.status === 404) return { ...
|
|
268
|
+
if (err instanceof ApiError && err.status === 404) return { ...NO_ACCOUNT };
|
|
268
269
|
throw err;
|
|
269
270
|
}
|
|
270
271
|
}
|
|
@@ -1234,6 +1235,6 @@ var PROXY_KINDS = ["http", "socks5", "gateway"];
|
|
|
1234
1235
|
var ROTATIONS = ["sticky", "rotating"];
|
|
1235
1236
|
|
|
1236
1237
|
// src/index.ts
|
|
1237
|
-
var VERSION = "0.
|
|
1238
|
+
var VERSION = "0.3.0";
|
|
1238
1239
|
|
|
1239
1240
|
export { ApiError, CdpError, CdpSession, DEFAULT_CAPACITY, ErrorCode, GEO_MODES, HOST_MODES, NetworkError, PROXY_KINDS, ROTATIONS, RUNTIME_STATES, ScalebrowserClient, ScalebrowserError, VERSION, deriveMetricsFromProfiles, errorMessage, eventStream, openCdpSession, parseSseFrame, subscribeEvents };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalebrowser/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Official Node/TypeScript SDK for the Scalebrowser daemon — typed REST client + direct-CDP driver plane (nodriver-style, not Playwright).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|