@bctrl/sdk 1.0.2 → 1.0.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/README.md +11 -7
- package/dist/bctrl.d.ts +15 -15
- package/dist/bctrl.js +14 -14
- package/dist/errors.d.ts +14 -14
- package/dist/errors.js +1 -1
- package/dist/files.d.ts +21 -21
- package/dist/files.js +14 -14
- package/dist/http.d.ts +6 -6
- package/dist/http.js +17 -17
- package/dist/index.d.ts +7 -7
- package/dist/index.js +6 -7
- package/dist/invocations.d.ts +78 -16
- package/dist/invocations.js +99 -6
- package/dist/pagination.d.ts +2 -2
- package/dist/pagination.js +1 -1
- package/dist/runs.d.ts +29 -27
- package/dist/runs.js +20 -14
- package/dist/runtimes.d.ts +45 -49
- package/dist/runtimes.js +23 -26
- package/dist/spaces.d.ts +29 -30
- package/dist/spaces.js +22 -22
- package/dist/types.d.ts +116 -89
- package/package.json +14 -12
- package/dist/browsers.d.ts +0 -24
- package/dist/browsers.js +0 -82
package/dist/spaces.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export class V2SpaceEnvironmentClient {
|
|
1
|
+
import { iterateV1Pages } from './pagination.js';
|
|
2
|
+
import { V1RuntimesClient } from './runtimes.js';
|
|
3
|
+
export class V1SpaceEnvironmentClient {
|
|
5
4
|
http;
|
|
6
5
|
spaceId;
|
|
7
6
|
constructor(http, spaceId) {
|
|
@@ -18,7 +17,7 @@ export class V2SpaceEnvironmentClient {
|
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
|
-
export class
|
|
20
|
+
export class V1SpaceRuntimesClient {
|
|
22
21
|
http;
|
|
23
22
|
spaceId;
|
|
24
23
|
constructor(http, spaceId) {
|
|
@@ -26,45 +25,46 @@ export class V2SpaceRuntimesClient {
|
|
|
26
25
|
this.spaceId = spaceId;
|
|
27
26
|
}
|
|
28
27
|
list(query = {}) {
|
|
29
|
-
return new
|
|
28
|
+
return new V1RuntimesClient(this.http).list({ ...query, spaceId: this.spaceId });
|
|
30
29
|
}
|
|
31
30
|
iter(query = {}) {
|
|
32
|
-
return new
|
|
31
|
+
return new V1RuntimesClient(this.http).iter({ ...query, spaceId: this.spaceId });
|
|
33
32
|
}
|
|
34
33
|
async create(request) {
|
|
35
|
-
return new
|
|
34
|
+
return new V1RuntimesClient(this.http).createInSpace(this.spaceId, request);
|
|
36
35
|
}
|
|
37
36
|
async get(runtimeId) {
|
|
38
|
-
return new
|
|
37
|
+
return new V1RuntimesClient(this.http).get(runtimeId);
|
|
39
38
|
}
|
|
40
39
|
stop(runtimeId) {
|
|
41
|
-
return new
|
|
40
|
+
return new V1RuntimesClient(this.http).stop(runtimeId);
|
|
41
|
+
}
|
|
42
|
+
start(runtimeId) {
|
|
43
|
+
return new V1RuntimesClient(this.http).start(runtimeId);
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
export class
|
|
46
|
+
export class V1SpaceResource {
|
|
45
47
|
http;
|
|
46
48
|
data;
|
|
47
49
|
environment;
|
|
48
50
|
runtimes;
|
|
49
|
-
browsers;
|
|
50
51
|
constructor(http, data) {
|
|
51
52
|
this.http = http;
|
|
52
53
|
this.data = data;
|
|
53
|
-
this.environment = new
|
|
54
|
-
this.runtimes = new
|
|
55
|
-
this.browsers = new V2SpaceBrowsersClient(http, data.id);
|
|
54
|
+
this.environment = new V1SpaceEnvironmentClient(http, data.id);
|
|
55
|
+
this.runtimes = new V1SpaceRuntimesClient(http, data.id);
|
|
56
56
|
}
|
|
57
57
|
get id() {
|
|
58
58
|
return this.data.id;
|
|
59
59
|
}
|
|
60
60
|
refresh() {
|
|
61
|
-
return new
|
|
61
|
+
return new V1SpacesClient(this.http).get(this.id);
|
|
62
62
|
}
|
|
63
63
|
async update(request) {
|
|
64
|
-
return new
|
|
64
|
+
return new V1SpacesClient(this.http).update(this.id, request);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
export class
|
|
67
|
+
export class V1SpacesClient {
|
|
68
68
|
http;
|
|
69
69
|
constructor(http) {
|
|
70
70
|
this.http = http;
|
|
@@ -73,24 +73,24 @@ export class V2SpacesClient {
|
|
|
73
73
|
return this.http.request('/spaces');
|
|
74
74
|
}
|
|
75
75
|
iter() {
|
|
76
|
-
return
|
|
76
|
+
return iterateV1Pages({}, () => this.list());
|
|
77
77
|
}
|
|
78
78
|
async create(request) {
|
|
79
79
|
const space = await this.http.request('/spaces', {
|
|
80
80
|
method: 'POST',
|
|
81
81
|
body: request,
|
|
82
82
|
});
|
|
83
|
-
return new
|
|
83
|
+
return new V1SpaceResource(this.http, space);
|
|
84
84
|
}
|
|
85
85
|
async get(id) {
|
|
86
86
|
const space = await this.http.request(`/spaces/${encodeURIComponent(id)}`);
|
|
87
|
-
return new
|
|
87
|
+
return new V1SpaceResource(this.http, space);
|
|
88
88
|
}
|
|
89
89
|
async update(id, request) {
|
|
90
90
|
const space = await this.http.request(`/spaces/${encodeURIComponent(id)}`, {
|
|
91
91
|
method: 'PATCH',
|
|
92
92
|
body: request,
|
|
93
93
|
});
|
|
94
|
-
return new
|
|
94
|
+
return new V1SpaceResource(this.http, space);
|
|
95
95
|
}
|
|
96
96
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,23 +3,23 @@ export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
|
3
3
|
export type JsonObject = {
|
|
4
4
|
[key: string]: JsonValue;
|
|
5
5
|
};
|
|
6
|
-
export interface
|
|
6
|
+
export interface V1ListEnvelope<T> {
|
|
7
7
|
data: T[];
|
|
8
8
|
nextCursor: string | null;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface V1PageQuery {
|
|
11
11
|
cursor?: string;
|
|
12
12
|
limit?: number;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface V1SpaceCreateRequest {
|
|
15
15
|
name: string;
|
|
16
16
|
region: string;
|
|
17
17
|
subaccountId?: string | null;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface V1SpaceUpdateRequest {
|
|
20
20
|
name?: string;
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface V1Space {
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
|
25
25
|
region: string;
|
|
@@ -27,18 +27,18 @@ export interface V2Space {
|
|
|
27
27
|
createdAt: string;
|
|
28
28
|
updatedAt: string;
|
|
29
29
|
}
|
|
30
|
-
export interface
|
|
30
|
+
export interface V1SpaceEnvironment {
|
|
31
31
|
spaceId: string;
|
|
32
32
|
mounts: JsonObject;
|
|
33
33
|
updatedAt: string;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
35
|
+
export interface V1SpaceEnvironmentUpdateRequest {
|
|
36
36
|
mounts: JsonObject;
|
|
37
37
|
}
|
|
38
|
-
export type
|
|
39
|
-
export type
|
|
40
|
-
export type
|
|
41
|
-
export type
|
|
38
|
+
export type V1RuntimeType = 'browser';
|
|
39
|
+
export type V1RuntimeStatus = 'active' | 'stopped' | 'failed';
|
|
40
|
+
export type V1BrowserStealth = 'medium' | 'high' | 'ultra';
|
|
41
|
+
export type V1ProxyInput = {
|
|
42
42
|
mode: 'custom';
|
|
43
43
|
protocol: string;
|
|
44
44
|
host: string;
|
|
@@ -50,51 +50,51 @@ export type V2ProxyInput = {
|
|
|
50
50
|
id: string;
|
|
51
51
|
overrides?: JsonObject;
|
|
52
52
|
};
|
|
53
|
-
export interface
|
|
53
|
+
export interface V1RuntimeFingerprintCreateConfig {
|
|
54
54
|
browser?: string;
|
|
55
55
|
locale?: string;
|
|
56
56
|
}
|
|
57
|
-
export interface
|
|
57
|
+
export interface V1RuntimeLifecycleConfig {
|
|
58
58
|
idleTimeoutMinutes?: number;
|
|
59
59
|
}
|
|
60
|
-
export interface
|
|
60
|
+
export interface V1BrowserRuntimeCreateConfig {
|
|
61
61
|
browser?: {
|
|
62
62
|
profile?: boolean;
|
|
63
63
|
};
|
|
64
|
-
stealth?:
|
|
65
|
-
proxy?:
|
|
66
|
-
fingerprint?:
|
|
64
|
+
stealth?: V1BrowserStealth;
|
|
65
|
+
proxy?: V1ProxyInput | null;
|
|
66
|
+
fingerprint?: V1RuntimeFingerprintCreateConfig;
|
|
67
67
|
extensions?: string[];
|
|
68
|
-
lifecycle?:
|
|
68
|
+
lifecycle?: V1RuntimeLifecycleConfig;
|
|
69
69
|
}
|
|
70
|
-
export interface
|
|
70
|
+
export interface V1RuntimeCreateRequest {
|
|
71
71
|
spaceId: string;
|
|
72
|
-
type:
|
|
72
|
+
type: V1RuntimeType;
|
|
73
73
|
name?: string;
|
|
74
74
|
metadata?: JsonObject;
|
|
75
|
-
config?:
|
|
75
|
+
config?: V1BrowserRuntimeCreateConfig;
|
|
76
76
|
}
|
|
77
|
-
export type
|
|
78
|
-
export interface
|
|
77
|
+
export type V1SpaceRuntimeCreateRequest = Omit<V1RuntimeCreateRequest, 'spaceId'>;
|
|
78
|
+
export interface V1RuntimeListQuery {
|
|
79
79
|
spaceId?: string;
|
|
80
80
|
status?: string | string[];
|
|
81
81
|
limit?: number;
|
|
82
82
|
}
|
|
83
|
-
export interface
|
|
83
|
+
export interface V1RuntimeSummary {
|
|
84
84
|
id: string;
|
|
85
85
|
name: string;
|
|
86
|
-
type:
|
|
87
|
-
status:
|
|
86
|
+
type: V1RuntimeType;
|
|
87
|
+
status: V1RuntimeStatus;
|
|
88
88
|
activeRunId: string | null;
|
|
89
89
|
createdAt: string;
|
|
90
90
|
updatedAt: string;
|
|
91
91
|
}
|
|
92
|
-
export interface
|
|
92
|
+
export interface V1Runtime extends V1RuntimeSummary {
|
|
93
93
|
config?: JsonObject;
|
|
94
94
|
metadata?: JsonObject | null;
|
|
95
95
|
}
|
|
96
|
-
export type
|
|
97
|
-
export type
|
|
96
|
+
export type V1ConnectionProtocol = 'cdp' | 'cua' | 'rdp' | 'vnc' | 'mcp' | 'http';
|
|
97
|
+
export type V1ConnectionEndpoint = {
|
|
98
98
|
type: 'websocket';
|
|
99
99
|
url: string;
|
|
100
100
|
} | {
|
|
@@ -110,14 +110,14 @@ export type V2ConnectionEndpoint = {
|
|
|
110
110
|
type: 'composite';
|
|
111
111
|
endpoints: Record<string, string>;
|
|
112
112
|
};
|
|
113
|
-
export interface
|
|
113
|
+
export interface V1RuntimeConnectionCreateRequest {
|
|
114
114
|
protocol: 'cdp';
|
|
115
115
|
options?: JsonObject;
|
|
116
116
|
}
|
|
117
|
-
export type
|
|
118
|
-
export interface
|
|
117
|
+
export type V1RuntimeConnectionCreateOptions = Partial<V1RuntimeConnectionCreateRequest>;
|
|
118
|
+
export interface V1RuntimeConnection {
|
|
119
119
|
id: string;
|
|
120
|
-
protocol:
|
|
120
|
+
protocol: V1ConnectionProtocol;
|
|
121
121
|
status: string;
|
|
122
122
|
runId: string;
|
|
123
123
|
createdAt: string;
|
|
@@ -125,27 +125,27 @@ export interface V2RuntimeConnection {
|
|
|
125
125
|
closedAt?: string | null;
|
|
126
126
|
revokedAt?: string | null;
|
|
127
127
|
}
|
|
128
|
-
export interface
|
|
129
|
-
endpoint:
|
|
128
|
+
export interface V1RuntimeConnectionCreateResponse extends V1RuntimeConnection {
|
|
129
|
+
endpoint: V1ConnectionEndpoint;
|
|
130
130
|
}
|
|
131
|
-
export interface
|
|
132
|
-
runtime:
|
|
133
|
-
run:
|
|
131
|
+
export interface V1RuntimeStartResponse {
|
|
132
|
+
runtime: V1Runtime;
|
|
133
|
+
run: V1Run;
|
|
134
134
|
}
|
|
135
|
-
export interface
|
|
135
|
+
export interface V1RunListQuery extends V1PageQuery {
|
|
136
136
|
status?: string | string[];
|
|
137
137
|
spaceId?: string;
|
|
138
138
|
runtimeId?: string;
|
|
139
139
|
}
|
|
140
|
-
export type
|
|
141
|
-
export interface
|
|
140
|
+
export type V1RuntimeRunListQuery = Omit<V1RunListQuery, 'spaceId' | 'runtimeId'>;
|
|
141
|
+
export interface V1RunSummary {
|
|
142
142
|
id: string;
|
|
143
143
|
status: string;
|
|
144
144
|
createdAt: string;
|
|
145
145
|
startedAt: string;
|
|
146
146
|
finishedAt?: string | null;
|
|
147
147
|
}
|
|
148
|
-
export interface
|
|
148
|
+
export interface V1Run extends V1RunSummary {
|
|
149
149
|
spaceId: string;
|
|
150
150
|
runtimeId: string;
|
|
151
151
|
runtimeType: string;
|
|
@@ -154,7 +154,44 @@ export interface V2Run extends V2RunSummary {
|
|
|
154
154
|
endedReason?: string | null;
|
|
155
155
|
failureReason?: string | null;
|
|
156
156
|
}
|
|
157
|
-
export interface
|
|
157
|
+
export interface V1RunUsage {
|
|
158
|
+
runId: string;
|
|
159
|
+
runtimeId: string;
|
|
160
|
+
runtimeType: string;
|
|
161
|
+
status: string;
|
|
162
|
+
computedAt: string;
|
|
163
|
+
usage: {
|
|
164
|
+
runtime: {
|
|
165
|
+
seconds: number | null;
|
|
166
|
+
billingClass: string | null;
|
|
167
|
+
};
|
|
168
|
+
aiTokens: {
|
|
169
|
+
input: number | null;
|
|
170
|
+
output: number | null;
|
|
171
|
+
total: number | null;
|
|
172
|
+
};
|
|
173
|
+
proxyBytes: number | null;
|
|
174
|
+
captchaSolves: number;
|
|
175
|
+
files: {
|
|
176
|
+
count: number;
|
|
177
|
+
bytes: number;
|
|
178
|
+
};
|
|
179
|
+
invocations: number;
|
|
180
|
+
toolCalls: number;
|
|
181
|
+
};
|
|
182
|
+
billing: {
|
|
183
|
+
status: 'pending' | 'settled' | 'unavailable';
|
|
184
|
+
creditCost: number | null;
|
|
185
|
+
breakdown: {
|
|
186
|
+
runtime: number | null;
|
|
187
|
+
ai: number | null;
|
|
188
|
+
proxy: number | null;
|
|
189
|
+
captcha: number | null;
|
|
190
|
+
files: number | null;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
export interface V1RunEvent {
|
|
158
195
|
id: string;
|
|
159
196
|
runId: string;
|
|
160
197
|
runtimeId: string;
|
|
@@ -171,48 +208,48 @@ export interface V2RunEvent {
|
|
|
171
208
|
name?: string;
|
|
172
209
|
data?: JsonObject;
|
|
173
210
|
}
|
|
174
|
-
export interface
|
|
211
|
+
export interface V1RunEventsListQuery extends V1PageQuery {
|
|
175
212
|
type?: string | string[];
|
|
176
213
|
category?: string | string[];
|
|
177
214
|
connectionId?: string;
|
|
178
215
|
}
|
|
179
|
-
export interface
|
|
216
|
+
export interface V1RunEventsWaitRequest {
|
|
180
217
|
cursor?: string;
|
|
181
218
|
timeoutMs?: number;
|
|
182
219
|
type?: string[];
|
|
183
220
|
category?: string[];
|
|
184
221
|
connectionId?: string;
|
|
185
222
|
}
|
|
186
|
-
export interface
|
|
187
|
-
data:
|
|
223
|
+
export interface V1RunEventsWaitResponse {
|
|
224
|
+
data: V1RunEvent | null;
|
|
188
225
|
cursor: string | null;
|
|
189
226
|
timedOut: boolean;
|
|
190
227
|
}
|
|
191
|
-
export type
|
|
228
|
+
export type V1RunCommand = V1RunEvent & {
|
|
192
229
|
category: 'command';
|
|
193
230
|
};
|
|
194
|
-
export interface
|
|
231
|
+
export interface V1RunCommandsListQuery extends V1PageQuery {
|
|
195
232
|
type?: string | string[];
|
|
196
233
|
connectionId?: string;
|
|
197
234
|
}
|
|
198
|
-
export interface
|
|
235
|
+
export interface V1RunLiveRequest {
|
|
199
236
|
control?: string;
|
|
200
237
|
expiresInSeconds?: number;
|
|
201
238
|
}
|
|
202
|
-
export interface
|
|
239
|
+
export interface V1RunLiveResponse {
|
|
203
240
|
iframeUrl: string;
|
|
204
241
|
expiresAt: string;
|
|
205
242
|
}
|
|
206
|
-
export interface
|
|
243
|
+
export interface V1RunRecordingRequest {
|
|
207
244
|
expiresInSeconds?: number;
|
|
208
245
|
}
|
|
209
|
-
export interface
|
|
246
|
+
export interface V1RunRecordingResponse {
|
|
210
247
|
iframeUrl: string;
|
|
211
248
|
status: string;
|
|
212
249
|
durationMs?: number;
|
|
213
250
|
expiresAt: string;
|
|
214
251
|
}
|
|
215
|
-
export interface
|
|
252
|
+
export interface V1Invocation {
|
|
216
253
|
id: string;
|
|
217
254
|
runId: string;
|
|
218
255
|
spaceId: string;
|
|
@@ -230,32 +267,32 @@ export interface V2Invocation {
|
|
|
230
267
|
durationMs?: number | null;
|
|
231
268
|
metadata?: JsonObject | null;
|
|
232
269
|
}
|
|
233
|
-
export interface
|
|
234
|
-
data:
|
|
270
|
+
export interface V1InvocationResponse {
|
|
271
|
+
data: V1Invocation;
|
|
235
272
|
}
|
|
236
|
-
export interface
|
|
273
|
+
export interface V1InvocationWaitRequest {
|
|
237
274
|
timeoutMs?: number;
|
|
238
275
|
}
|
|
239
|
-
export interface
|
|
240
|
-
data:
|
|
276
|
+
export interface V1InvocationWaitResponse {
|
|
277
|
+
data: V1Invocation;
|
|
241
278
|
timedOut: boolean;
|
|
242
279
|
}
|
|
243
|
-
export type
|
|
280
|
+
export type V1RuntimeInvocationFileInput = {
|
|
244
281
|
storagePath: string;
|
|
245
282
|
name?: string;
|
|
246
283
|
} | {
|
|
247
284
|
fileId: string;
|
|
248
285
|
name?: string;
|
|
249
286
|
};
|
|
250
|
-
interface
|
|
287
|
+
interface V1RuntimeInvocationAgentFields {
|
|
251
288
|
target?: JsonObject;
|
|
252
289
|
idempotencyKey?: string;
|
|
253
290
|
outputSchema?: JsonObject;
|
|
254
291
|
toolsetId?: string;
|
|
255
292
|
metadata?: JsonObject;
|
|
256
|
-
files?:
|
|
293
|
+
files?: V1RuntimeInvocationFileInput[];
|
|
257
294
|
}
|
|
258
|
-
export type
|
|
295
|
+
export type V1RuntimeInvocationCreateRequest = {
|
|
259
296
|
provider: 'stagehand';
|
|
260
297
|
method: 'act' | 'observe';
|
|
261
298
|
target?: JsonObject;
|
|
@@ -270,13 +307,13 @@ export type V2RuntimeInvocationCreateRequest = {
|
|
|
270
307
|
outputSchema?: JsonObject;
|
|
271
308
|
idempotencyKey?: string;
|
|
272
309
|
metadata?: JsonObject;
|
|
273
|
-
} | (
|
|
310
|
+
} | (V1RuntimeInvocationAgentFields & {
|
|
274
311
|
provider: 'stagehand';
|
|
275
312
|
method: 'agent';
|
|
276
313
|
input: JsonObject;
|
|
277
314
|
config?: JsonObject;
|
|
278
315
|
options?: JsonObject;
|
|
279
|
-
}) | (
|
|
316
|
+
}) | (V1RuntimeInvocationAgentFields & {
|
|
280
317
|
provider: 'browserUse';
|
|
281
318
|
method: 'agent';
|
|
282
319
|
input: JsonObject;
|
|
@@ -290,7 +327,7 @@ export type V2RuntimeInvocationCreateRequest = {
|
|
|
290
327
|
idempotencyKey?: string;
|
|
291
328
|
metadata?: JsonObject;
|
|
292
329
|
};
|
|
293
|
-
export interface
|
|
330
|
+
export interface V1File {
|
|
294
331
|
id: string;
|
|
295
332
|
type: string;
|
|
296
333
|
source: 'upload' | 'runtime' | 'system';
|
|
@@ -306,7 +343,7 @@ export interface V2File {
|
|
|
306
343
|
expiresAt?: string | null;
|
|
307
344
|
downloadUrl?: string;
|
|
308
345
|
}
|
|
309
|
-
export interface
|
|
346
|
+
export interface V1FilesListQuery extends V1PageQuery {
|
|
310
347
|
spaceId: string;
|
|
311
348
|
source?: 'upload' | 'runtime' | 'system';
|
|
312
349
|
path?: string;
|
|
@@ -314,38 +351,38 @@ export interface V2FilesListQuery extends V2PageQuery {
|
|
|
314
351
|
query?: string;
|
|
315
352
|
contentType?: string;
|
|
316
353
|
}
|
|
317
|
-
export interface
|
|
354
|
+
export interface V1FileUpdateRequest {
|
|
318
355
|
name?: string;
|
|
319
356
|
metadata?: JsonObject | null;
|
|
320
357
|
}
|
|
321
|
-
export interface
|
|
358
|
+
export interface V1FileDeleteResponse {
|
|
322
359
|
success: true;
|
|
323
360
|
}
|
|
324
|
-
export interface
|
|
361
|
+
export interface V1FileUploadRequest {
|
|
325
362
|
spaceId: string;
|
|
326
363
|
file: Blob;
|
|
327
364
|
name?: string;
|
|
328
365
|
path?: string;
|
|
329
366
|
metadata?: JsonObject;
|
|
330
367
|
}
|
|
331
|
-
export interface
|
|
368
|
+
export interface V1RunFilesListQuery extends V1PageQuery {
|
|
332
369
|
type?: string | string[];
|
|
333
370
|
}
|
|
334
|
-
export interface
|
|
371
|
+
export interface V1RunFilesExportRequest {
|
|
335
372
|
format: 'zip';
|
|
336
373
|
name: string;
|
|
337
374
|
filter?: {
|
|
338
375
|
type?: string[];
|
|
339
376
|
};
|
|
340
377
|
}
|
|
341
|
-
export type
|
|
378
|
+
export type V1RuntimeFileStageRequest = {
|
|
342
379
|
storagePath: string;
|
|
343
380
|
name?: string;
|
|
344
381
|
} | {
|
|
345
382
|
fileId: string;
|
|
346
383
|
name?: string;
|
|
347
384
|
};
|
|
348
|
-
export interface
|
|
385
|
+
export interface V1RuntimeStagedFile {
|
|
349
386
|
id: string;
|
|
350
387
|
runtimeId: string;
|
|
351
388
|
runtimePath: string;
|
|
@@ -353,17 +390,17 @@ export interface V2RuntimeStagedFile {
|
|
|
353
390
|
sizeBytes: number;
|
|
354
391
|
expiresAt: string | null;
|
|
355
392
|
}
|
|
356
|
-
export interface
|
|
393
|
+
export interface V1RuntimeFileUploadRequest {
|
|
357
394
|
file: Blob;
|
|
358
395
|
name?: string;
|
|
359
396
|
storagePath?: string;
|
|
360
397
|
metadata?: JsonObject;
|
|
361
398
|
}
|
|
362
|
-
export interface
|
|
363
|
-
file:
|
|
364
|
-
staged:
|
|
399
|
+
export interface V1RuntimeFileUploadResponse {
|
|
400
|
+
file: V1File;
|
|
401
|
+
staged: V1RuntimeStagedFile;
|
|
365
402
|
}
|
|
366
|
-
export interface
|
|
403
|
+
export interface V1RuntimeFileCollectRequest {
|
|
367
404
|
path: string;
|
|
368
405
|
storagePath?: string;
|
|
369
406
|
name?: string;
|
|
@@ -373,14 +410,4 @@ export interface V2RuntimeFileCollectRequest {
|
|
|
373
410
|
metadata?: JsonObject;
|
|
374
411
|
};
|
|
375
412
|
}
|
|
376
|
-
export interface BrowserLaunchOptions {
|
|
377
|
-
name: string;
|
|
378
|
-
state?: 'ephemeral' | 'profile';
|
|
379
|
-
metadata?: JsonObject;
|
|
380
|
-
lifecycle?: V2RuntimeLifecycleConfig;
|
|
381
|
-
stealth?: V2BrowserStealth;
|
|
382
|
-
proxy?: V2ProxyInput | null;
|
|
383
|
-
fingerprint?: V2RuntimeFingerprintCreateConfig;
|
|
384
|
-
extensions?: string[];
|
|
385
|
-
}
|
|
386
413
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bctrl/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "BCTRL SDK - Remote browser automation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,9 +11,20 @@
|
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"clean": "rm -rf dist",
|
|
16
|
+
"build": "pnpm run clean && tsc -p tsconfig.json",
|
|
17
|
+
"prepack": "pnpm run build",
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"test": "tsx --test tests/v1/*.test.ts tests/v1/e2e/*.test.ts",
|
|
20
|
+
"test:v1": "tsx --test tests/v1/*.test.ts tests/v1/e2e/*.test.ts",
|
|
21
|
+
"test:v1:e2e": "BCTRL_E2E=1 tsx --test tests/v1/e2e/**/*.test.ts",
|
|
22
|
+
"typecheck": "tsc --noEmit"
|
|
23
|
+
},
|
|
14
24
|
"keywords": [],
|
|
15
25
|
"author": "",
|
|
16
26
|
"license": "ISC",
|
|
27
|
+
"packageManager": "pnpm@10.12.4",
|
|
17
28
|
"devDependencies": {
|
|
18
29
|
"@types/node": "^25.0.3",
|
|
19
30
|
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
@@ -24,14 +35,5 @@
|
|
|
24
35
|
},
|
|
25
36
|
"files": [
|
|
26
37
|
"dist"
|
|
27
|
-
]
|
|
28
|
-
|
|
29
|
-
"clean": "rm -rf dist",
|
|
30
|
-
"build": "pnpm run clean && tsc -p tsconfig.json",
|
|
31
|
-
"dev": "tsc --watch",
|
|
32
|
-
"test": "tsx --test tests/v2/*.test.ts tests/v2/e2e/*.test.ts",
|
|
33
|
-
"test:v2": "tsx --test tests/v2/*.test.ts tests/v2/e2e/*.test.ts",
|
|
34
|
-
"test:v2:e2e": "BCTRL_E2E=1 tsx --test tests/v2/e2e/**/*.test.ts",
|
|
35
|
-
"typecheck": "tsc --noEmit"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
+
]
|
|
39
|
+
}
|
package/dist/browsers.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { V2HttpClient } from './http.js';
|
|
2
|
-
import type { V2RuntimeInvocationsClient } from './invocations.js';
|
|
3
|
-
import { V2RuntimeConnectionResource, V2RuntimeResource } from './runtimes.js';
|
|
4
|
-
import { V2RunResource } from './runs.js';
|
|
5
|
-
import type { BrowserLaunchOptions, V2Runtime, V2RuntimeConnectionCreateOptions } from './types.js';
|
|
6
|
-
export declare class V2BrowserResource {
|
|
7
|
-
private readonly http;
|
|
8
|
-
private readonly spaceId;
|
|
9
|
-
readonly runtime: V2RuntimeResource;
|
|
10
|
-
constructor(http: V2HttpClient, spaceId: string, runtime: V2RuntimeResource);
|
|
11
|
-
get id(): string;
|
|
12
|
-
get data(): V2Runtime;
|
|
13
|
-
get invocations(): V2RuntimeInvocationsClient;
|
|
14
|
-
connect(request?: V2RuntimeConnectionCreateOptions): Promise<V2RuntimeConnectionResource>;
|
|
15
|
-
run(): Promise<V2RunResource>;
|
|
16
|
-
stop(): Promise<V2Runtime>;
|
|
17
|
-
refresh(): Promise<V2BrowserResource>;
|
|
18
|
-
}
|
|
19
|
-
export declare class V2SpaceBrowsersClient {
|
|
20
|
-
private readonly http;
|
|
21
|
-
private readonly spaceId;
|
|
22
|
-
constructor(http: V2HttpClient, spaceId: string);
|
|
23
|
-
launch(options: BrowserLaunchOptions): Promise<V2BrowserResource>;
|
|
24
|
-
}
|