@onkernel/sdk 0.8.2 → 0.9.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/CHANGELOG.md +32 -0
- package/package.json +4 -5
- package/resources/browsers/browsers.d.mts +4 -0
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +4 -0
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +4 -0
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +4 -0
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/fs/fs.d.mts +253 -0
- package/resources/browsers/fs/fs.d.mts.map +1 -0
- package/resources/browsers/fs/fs.d.ts +253 -0
- package/resources/browsers/fs/fs.d.ts.map +1 -0
- package/resources/browsers/fs/fs.js +175 -0
- package/resources/browsers/fs/fs.js.map +1 -0
- package/resources/browsers/fs/fs.mjs +170 -0
- package/resources/browsers/fs/fs.mjs.map +1 -0
- package/resources/browsers/fs/index.d.mts +3 -0
- package/resources/browsers/fs/index.d.mts.map +1 -0
- package/resources/browsers/fs/index.d.ts +3 -0
- package/resources/browsers/fs/index.d.ts.map +1 -0
- package/resources/browsers/fs/index.js +9 -0
- package/resources/browsers/fs/index.js.map +1 -0
- package/resources/browsers/fs/index.mjs +4 -0
- package/resources/browsers/fs/index.mjs.map +1 -0
- package/resources/browsers/fs/watch.d.mts +94 -0
- package/resources/browsers/fs/watch.d.mts.map +1 -0
- package/resources/browsers/fs/watch.d.ts +94 -0
- package/resources/browsers/fs/watch.d.ts.map +1 -0
- package/resources/browsers/fs/watch.js +61 -0
- package/resources/browsers/fs/watch.js.map +1 -0
- package/resources/browsers/fs/watch.mjs +57 -0
- package/resources/browsers/fs/watch.mjs.map +1 -0
- package/resources/browsers/fs.d.mts +2 -0
- package/resources/browsers/fs.d.mts.map +1 -0
- package/resources/browsers/fs.d.ts +2 -0
- package/resources/browsers/fs.d.ts.map +1 -0
- package/resources/browsers/fs.js +6 -0
- package/resources/browsers/fs.js.map +1 -0
- package/resources/browsers/fs.mjs +3 -0
- package/resources/browsers/fs.mjs.map +1 -0
- package/resources/browsers/index.d.mts +1 -0
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -0
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js +3 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs +1 -0
- package/resources/browsers/index.mjs.map +1 -1
- package/src/resources/browsers/browsers.ts +32 -0
- package/src/resources/browsers/fs/fs.ts +385 -0
- package/src/resources/browsers/fs/index.ts +24 -0
- package/src/resources/browsers/fs/watch.ts +135 -0
- package/src/resources/browsers/fs.ts +3 -0
- package/src/resources/browsers/index.ts +14 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { Stream } from "../../../core/streaming.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Watch extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Stream filesystem events for a watch
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const response = await client.browsers.fs.watch.events(
|
|
12
|
+
* 'watch_id',
|
|
13
|
+
* { id: 'id' },
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
events(watchID: string, params: WatchEventsParams, options?: RequestOptions): APIPromise<Stream<WatchEventsResponse>>;
|
|
18
|
+
/**
|
|
19
|
+
* Watch a directory for changes
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const response = await client.browsers.fs.watch.start(
|
|
24
|
+
* 'id',
|
|
25
|
+
* { path: 'path' },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
start(id: string, body: WatchStartParams, options?: RequestOptions): APIPromise<WatchStartResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Stop watching a directory
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* await client.browsers.fs.watch.stop('watch_id', {
|
|
36
|
+
* id: 'id',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
stop(watchID: string, params: WatchStopParams, options?: RequestOptions): APIPromise<void>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Filesystem change event.
|
|
44
|
+
*/
|
|
45
|
+
export interface WatchEventsResponse {
|
|
46
|
+
/**
|
|
47
|
+
* Absolute path of the file or directory.
|
|
48
|
+
*/
|
|
49
|
+
path: string;
|
|
50
|
+
/**
|
|
51
|
+
* Event type.
|
|
52
|
+
*/
|
|
53
|
+
type: 'CREATE' | 'WRITE' | 'DELETE' | 'RENAME';
|
|
54
|
+
/**
|
|
55
|
+
* Whether the affected path is a directory.
|
|
56
|
+
*/
|
|
57
|
+
is_dir?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Base name of the file or directory affected.
|
|
60
|
+
*/
|
|
61
|
+
name?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface WatchStartResponse {
|
|
64
|
+
/**
|
|
65
|
+
* Unique identifier for the directory watch
|
|
66
|
+
*/
|
|
67
|
+
watch_id?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface WatchEventsParams {
|
|
70
|
+
/**
|
|
71
|
+
* Browser session ID
|
|
72
|
+
*/
|
|
73
|
+
id: string;
|
|
74
|
+
}
|
|
75
|
+
export interface WatchStartParams {
|
|
76
|
+
/**
|
|
77
|
+
* Directory to watch.
|
|
78
|
+
*/
|
|
79
|
+
path: string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to watch recursively.
|
|
82
|
+
*/
|
|
83
|
+
recursive?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface WatchStopParams {
|
|
86
|
+
/**
|
|
87
|
+
* Browser session ID
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
export declare namespace Watch {
|
|
92
|
+
export { type WatchEventsResponse as WatchEventsResponse, type WatchStartResponse as WatchStartResponse, type WatchEventsParams as WatchEventsParams, type WatchStartParams as WatchStartParams, type WatchStopParams as WatchStopParams, };
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=watch.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.mts","sourceRoot":"","sources":["../../../src/resources/browsers/fs/watch.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAS1C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAInG;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAO3F;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAE/C;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { Stream } from "../../../core/streaming.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
export declare class Watch extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Stream filesystem events for a watch
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const response = await client.browsers.fs.watch.events(
|
|
12
|
+
* 'watch_id',
|
|
13
|
+
* { id: 'id' },
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
events(watchID: string, params: WatchEventsParams, options?: RequestOptions): APIPromise<Stream<WatchEventsResponse>>;
|
|
18
|
+
/**
|
|
19
|
+
* Watch a directory for changes
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const response = await client.browsers.fs.watch.start(
|
|
24
|
+
* 'id',
|
|
25
|
+
* { path: 'path' },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
start(id: string, body: WatchStartParams, options?: RequestOptions): APIPromise<WatchStartResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Stop watching a directory
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* await client.browsers.fs.watch.stop('watch_id', {
|
|
36
|
+
* id: 'id',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
stop(watchID: string, params: WatchStopParams, options?: RequestOptions): APIPromise<void>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Filesystem change event.
|
|
44
|
+
*/
|
|
45
|
+
export interface WatchEventsResponse {
|
|
46
|
+
/**
|
|
47
|
+
* Absolute path of the file or directory.
|
|
48
|
+
*/
|
|
49
|
+
path: string;
|
|
50
|
+
/**
|
|
51
|
+
* Event type.
|
|
52
|
+
*/
|
|
53
|
+
type: 'CREATE' | 'WRITE' | 'DELETE' | 'RENAME';
|
|
54
|
+
/**
|
|
55
|
+
* Whether the affected path is a directory.
|
|
56
|
+
*/
|
|
57
|
+
is_dir?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Base name of the file or directory affected.
|
|
60
|
+
*/
|
|
61
|
+
name?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface WatchStartResponse {
|
|
64
|
+
/**
|
|
65
|
+
* Unique identifier for the directory watch
|
|
66
|
+
*/
|
|
67
|
+
watch_id?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface WatchEventsParams {
|
|
70
|
+
/**
|
|
71
|
+
* Browser session ID
|
|
72
|
+
*/
|
|
73
|
+
id: string;
|
|
74
|
+
}
|
|
75
|
+
export interface WatchStartParams {
|
|
76
|
+
/**
|
|
77
|
+
* Directory to watch.
|
|
78
|
+
*/
|
|
79
|
+
path: string;
|
|
80
|
+
/**
|
|
81
|
+
* Whether to watch recursively.
|
|
82
|
+
*/
|
|
83
|
+
recursive?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface WatchStopParams {
|
|
86
|
+
/**
|
|
87
|
+
* Browser session ID
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
export declare namespace Watch {
|
|
92
|
+
export { type WatchEventsResponse as WatchEventsResponse, type WatchStartResponse as WatchStartResponse, type WatchEventsParams as WatchEventsParams, type WatchStartParams as WatchStartParams, type WatchStopParams as WatchStopParams, };
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../src/resources/browsers/fs/watch.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OAEV,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAS1C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAInG;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAO3F;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAE/C;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Watch = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../../internal/headers.js");
|
|
7
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
+
class Watch extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Stream filesystem events for a watch
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response = await client.browsers.fs.watch.events(
|
|
15
|
+
* 'watch_id',
|
|
16
|
+
* { id: 'id' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
events(watchID, params, options) {
|
|
21
|
+
const { id } = params;
|
|
22
|
+
return this._client.get((0, path_1.path) `/browsers/${id}/fs/watch/${watchID}/events`, {
|
|
23
|
+
...options,
|
|
24
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
25
|
+
stream: true,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Watch a directory for changes
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const response = await client.browsers.fs.watch.start(
|
|
34
|
+
* 'id',
|
|
35
|
+
* { path: 'path' },
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
start(id, body, options) {
|
|
40
|
+
return this._client.post((0, path_1.path) `/browsers/${id}/fs/watch`, { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Stop watching a directory
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* await client.browsers.fs.watch.stop('watch_id', {
|
|
48
|
+
* id: 'id',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
stop(watchID, params, options) {
|
|
53
|
+
const { id } = params;
|
|
54
|
+
return this._client.delete((0, path_1.path) `/browsers/${id}/fs/watch/${watchID}`, {
|
|
55
|
+
...options,
|
|
56
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.Watch = Watch;
|
|
61
|
+
//# sourceMappingURL=watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../../src/resources/browsers/fs/watch.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAyD;AAEzD,0DAAoD;AAEpD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAe,EACf,MAAyB,EACzB,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,aAAa,OAAO,SAAS,EAAE;YACxE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA4C,CAAC;IAChD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAU,EAAE,IAAsB,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAe,EAAE,MAAuB,EAAE,OAAwB;QACrE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,aAAa,OAAO,EAAE,EAAE;YACpE,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AAzDD,sBAyDC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../../internal/headers.mjs";
|
|
4
|
+
import { path } from "../../../internal/utils/path.mjs";
|
|
5
|
+
export class Watch extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Stream filesystem events for a watch
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const response = await client.browsers.fs.watch.events(
|
|
12
|
+
* 'watch_id',
|
|
13
|
+
* { id: 'id' },
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
events(watchID, params, options) {
|
|
18
|
+
const { id } = params;
|
|
19
|
+
return this._client.get(path `/browsers/${id}/fs/watch/${watchID}/events`, {
|
|
20
|
+
...options,
|
|
21
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
22
|
+
stream: true,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Watch a directory for changes
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const response = await client.browsers.fs.watch.start(
|
|
31
|
+
* 'id',
|
|
32
|
+
* { path: 'path' },
|
|
33
|
+
* );
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
start(id, body, options) {
|
|
37
|
+
return this._client.post(path `/browsers/${id}/fs/watch`, { body, ...options });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Stop watching a directory
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* await client.browsers.fs.watch.stop('watch_id', {
|
|
45
|
+
* id: 'id',
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
stop(watchID, params, options) {
|
|
50
|
+
const { id } = params;
|
|
51
|
+
return this._client.delete(path `/browsers/${id}/fs/watch/${watchID}`, {
|
|
52
|
+
...options,
|
|
53
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=watch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.mjs","sourceRoot":"","sources":["../../../src/resources/browsers/fs/watch.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;OAUG;IACH,MAAM,CACJ,OAAe,EACf,MAAyB,EACzB,OAAwB;QAExB,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,aAAa,OAAO,SAAS,EAAE;YACxE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA4C,CAAC;IAChD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAU,EAAE,IAAsB,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,OAAe,EAAE,MAAuB,EAAE,OAAwB;QACrE,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,EAAE,aAAa,OAAO,EAAE,EAAE;YACpE,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.mts","sourceRoot":"","sources":["../../src/resources/browsers/fs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/resources/browsers/fs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./fs/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/resources/browsers/fs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.mjs","sourceRoot":"","sources":["../../src/resources/browsers/fs.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Browsers, type BrowserPersistence, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers.mjs";
|
|
2
|
+
export { Fs, type FFileInfoResponse, type FListFilesResponse, type FCreateDirectoryParams, type FDeleteDirectoryParams, type FDeleteFileParams, type FFileInfoParams, type FListFilesParams, type FMoveParams, type FReadFileParams, type FSetFilePermissionsParams, type FWriteFileParams, } from "./fs/index.mjs";
|
|
2
3
|
export { Replays, type ReplayListResponse, type ReplayStartResponse, type ReplayDownloadParams, type ReplayStartParams, type ReplayStopParams, } from "./replays.mjs";
|
|
3
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EACL,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EACL,EAAE,EACF,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,GACtB;OACM,EACL,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Browsers, type BrowserPersistence, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers.js";
|
|
2
|
+
export { Fs, type FFileInfoResponse, type FListFilesResponse, type FCreateDirectoryParams, type FDeleteDirectoryParams, type FDeleteFileParams, type FFileInfoParams, type FListFilesParams, type FMoveParams, type FReadFileParams, type FSetFilePermissionsParams, type FWriteFileParams, } from "./fs/index.js";
|
|
2
3
|
export { Replays, type ReplayListResponse, type ReplayStartResponse, type ReplayDownloadParams, type ReplayStartParams, type ReplayStopParams, } from "./replays.js";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EACL,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EACL,EAAE,EACF,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,GACtB;OACM,EACL,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Replays = exports.Browsers = void 0;
|
|
4
|
+
exports.Replays = exports.Fs = exports.Browsers = void 0;
|
|
5
5
|
var browsers_1 = require("./browsers.js");
|
|
6
6
|
Object.defineProperty(exports, "Browsers", { enumerable: true, get: function () { return browsers_1.Browsers; } });
|
|
7
|
+
var index_1 = require("./fs/index.js");
|
|
8
|
+
Object.defineProperty(exports, "Fs", { enumerable: true, get: function () { return index_1.Fs; } });
|
|
7
9
|
var replays_1 = require("./replays.js");
|
|
8
10
|
Object.defineProperty(exports, "Replays", { enumerable: true, get: function () { return replays_1.Replays; } });
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,wCAOmB;AANjB,kGAAA,OAAO,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,uCAaoB;AAZlB,2FAAA,EAAE,OAAA;AAaJ,wCAOmB;AANjB,kGAAA,OAAO,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAOT;OACM,EACL,OAAO,GAMR"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/browsers/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAOT;OACM,EACL,EAAE,GAYH;OACM,EACL,OAAO,GAMR"}
|
|
@@ -11,6 +11,21 @@ import {
|
|
|
11
11
|
ReplayStopParams,
|
|
12
12
|
Replays,
|
|
13
13
|
} from './replays';
|
|
14
|
+
import * as FsAPI from './fs/fs';
|
|
15
|
+
import {
|
|
16
|
+
FCreateDirectoryParams,
|
|
17
|
+
FDeleteDirectoryParams,
|
|
18
|
+
FDeleteFileParams,
|
|
19
|
+
FFileInfoParams,
|
|
20
|
+
FFileInfoResponse,
|
|
21
|
+
FListFilesParams,
|
|
22
|
+
FListFilesResponse,
|
|
23
|
+
FMoveParams,
|
|
24
|
+
FReadFileParams,
|
|
25
|
+
FSetFilePermissionsParams,
|
|
26
|
+
FWriteFileParams,
|
|
27
|
+
Fs,
|
|
28
|
+
} from './fs/fs';
|
|
14
29
|
import { APIPromise } from '../../core/api-promise';
|
|
15
30
|
import { buildHeaders } from '../../internal/headers';
|
|
16
31
|
import { RequestOptions } from '../../internal/request-options';
|
|
@@ -18,6 +33,7 @@ import { path } from '../../internal/utils/path';
|
|
|
18
33
|
|
|
19
34
|
export class Browsers extends APIResource {
|
|
20
35
|
replays: ReplaysAPI.Replays = new ReplaysAPI.Replays(this._client);
|
|
36
|
+
fs: FsAPI.Fs = new FsAPI.Fs(this._client);
|
|
21
37
|
|
|
22
38
|
/**
|
|
23
39
|
* Create a new browser session from within an action.
|
|
@@ -212,6 +228,7 @@ export interface BrowserDeleteParams {
|
|
|
212
228
|
}
|
|
213
229
|
|
|
214
230
|
Browsers.Replays = Replays;
|
|
231
|
+
Browsers.Fs = Fs;
|
|
215
232
|
|
|
216
233
|
export declare namespace Browsers {
|
|
217
234
|
export {
|
|
@@ -231,4 +248,19 @@ export declare namespace Browsers {
|
|
|
231
248
|
type ReplayStartParams as ReplayStartParams,
|
|
232
249
|
type ReplayStopParams as ReplayStopParams,
|
|
233
250
|
};
|
|
251
|
+
|
|
252
|
+
export {
|
|
253
|
+
Fs as Fs,
|
|
254
|
+
type FFileInfoResponse as FFileInfoResponse,
|
|
255
|
+
type FListFilesResponse as FListFilesResponse,
|
|
256
|
+
type FCreateDirectoryParams as FCreateDirectoryParams,
|
|
257
|
+
type FDeleteDirectoryParams as FDeleteDirectoryParams,
|
|
258
|
+
type FDeleteFileParams as FDeleteFileParams,
|
|
259
|
+
type FFileInfoParams as FFileInfoParams,
|
|
260
|
+
type FListFilesParams as FListFilesParams,
|
|
261
|
+
type FMoveParams as FMoveParams,
|
|
262
|
+
type FReadFileParams as FReadFileParams,
|
|
263
|
+
type FSetFilePermissionsParams as FSetFilePermissionsParams,
|
|
264
|
+
type FWriteFileParams as FWriteFileParams,
|
|
265
|
+
};
|
|
234
266
|
}
|