@onkernel/sdk 0.3.0 → 0.5.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 +38 -0
- package/README.md +23 -35
- package/internal/detect-platform.js +3 -3
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +3 -3
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/package.json +1 -4
- package/resources/apps/apps.d.mts +3 -4
- package/resources/apps/apps.d.mts.map +1 -1
- package/resources/apps/apps.d.ts +3 -4
- package/resources/apps/apps.d.ts.map +1 -1
- package/resources/apps/apps.js +1 -2
- package/resources/apps/apps.js.map +1 -1
- package/resources/apps/apps.mjs +1 -2
- package/resources/apps/apps.mjs.map +1 -1
- package/resources/apps/deployments.d.mts +1 -1
- package/resources/apps/deployments.d.ts +1 -1
- package/resources/apps/deployments.js +1 -1
- package/resources/apps/deployments.mjs +1 -1
- package/resources/apps/index.d.mts +1 -1
- package/resources/apps/index.d.mts.map +1 -1
- package/resources/apps/index.d.ts +1 -1
- package/resources/apps/index.d.ts.map +1 -1
- package/resources/apps/index.js.map +1 -1
- package/resources/apps/index.mjs.map +1 -1
- package/resources/apps/invocations.d.mts +70 -3
- package/resources/apps/invocations.d.mts.map +1 -1
- package/resources/apps/invocations.d.ts +70 -3
- package/resources/apps/invocations.d.ts.map +1 -1
- package/resources/apps/invocations.js +16 -2
- package/resources/apps/invocations.js.map +1 -1
- package/resources/apps/invocations.mjs +16 -2
- package/resources/apps/invocations.mjs.map +1 -1
- package/resources/browsers.d.mts +10 -5
- package/resources/browsers.d.mts.map +1 -1
- package/resources/browsers.d.ts +10 -5
- package/resources/browsers.d.ts.map +1 -1
- package/resources/browsers.js +5 -5
- package/resources/browsers.mjs +5 -5
- package/src/internal/detect-platform.ts +3 -3
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/resources/apps/apps.ts +5 -2
- package/src/resources/apps/deployments.ts +1 -1
- package/src/resources/apps/index.ts +2 -0
- package/src/resources/apps/invocations.ts +90 -2
- package/src/resources/browsers.ts +11 -5
- 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
- package/src/internal/shim-types.d.ts +0 -28
|
@@ -7,7 +7,7 @@ import { path } from '../../internal/utils/path';
|
|
|
7
7
|
|
|
8
8
|
export class Invocations extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Invoke an
|
|
10
|
+
* Invoke an action.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -23,7 +23,7 @@ export class Invocations extends APIResource {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Get an
|
|
26
|
+
* Get details about an invocation's status and output.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
@@ -35,6 +35,25 @@ export class Invocations extends APIResource {
|
|
|
35
35
|
retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse> {
|
|
36
36
|
return this._client.get(path`/invocations/${id}`, options);
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Update an invocation's status or output.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const invocation = await client.apps.invocations.update(
|
|
45
|
+
* 'id',
|
|
46
|
+
* { status: 'succeeded' },
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
update(
|
|
51
|
+
id: string,
|
|
52
|
+
body: InvocationUpdateParams,
|
|
53
|
+
options?: RequestOptions,
|
|
54
|
+
): APIPromise<InvocationUpdateResponse> {
|
|
55
|
+
return this._client.patch(path`/invocations/${id}`, { body, ...options });
|
|
56
|
+
}
|
|
38
57
|
}
|
|
39
58
|
|
|
40
59
|
export interface InvocationCreateResponse {
|
|
@@ -109,6 +128,55 @@ export interface InvocationRetrieveResponse {
|
|
|
109
128
|
status_reason?: string;
|
|
110
129
|
}
|
|
111
130
|
|
|
131
|
+
export interface InvocationUpdateResponse {
|
|
132
|
+
/**
|
|
133
|
+
* ID of the invocation
|
|
134
|
+
*/
|
|
135
|
+
id: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Name of the action invoked
|
|
139
|
+
*/
|
|
140
|
+
action_name: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Name of the application
|
|
144
|
+
*/
|
|
145
|
+
app_name: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* RFC 3339 Nanoseconds timestamp when the invocation started
|
|
149
|
+
*/
|
|
150
|
+
started_at: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Status of the invocation
|
|
154
|
+
*/
|
|
155
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
|
|
159
|
+
* running)
|
|
160
|
+
*/
|
|
161
|
+
finished_at?: string | null;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Output produced by the action, rendered as a JSON string. This could be: string,
|
|
165
|
+
* number, boolean, array, object, or null.
|
|
166
|
+
*/
|
|
167
|
+
output?: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Payload provided to the invocation. This is a string that can be parsed as JSON.
|
|
171
|
+
*/
|
|
172
|
+
payload?: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Status reason
|
|
176
|
+
*/
|
|
177
|
+
status_reason?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
112
180
|
export interface InvocationCreateParams {
|
|
113
181
|
/**
|
|
114
182
|
* Name of the action to invoke
|
|
@@ -125,16 +193,36 @@ export interface InvocationCreateParams {
|
|
|
125
193
|
*/
|
|
126
194
|
version: string;
|
|
127
195
|
|
|
196
|
+
/**
|
|
197
|
+
* If true, invoke asynchronously. When set, the API responds 202 Accepted with
|
|
198
|
+
* status "queued".
|
|
199
|
+
*/
|
|
200
|
+
async?: boolean;
|
|
201
|
+
|
|
128
202
|
/**
|
|
129
203
|
* Input data for the action, sent as a JSON string.
|
|
130
204
|
*/
|
|
131
205
|
payload?: string;
|
|
132
206
|
}
|
|
133
207
|
|
|
208
|
+
export interface InvocationUpdateParams {
|
|
209
|
+
/**
|
|
210
|
+
* New status for the invocation.
|
|
211
|
+
*/
|
|
212
|
+
status: 'succeeded' | 'failed';
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Updated output of the invocation rendered as JSON string.
|
|
216
|
+
*/
|
|
217
|
+
output?: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
134
220
|
export declare namespace Invocations {
|
|
135
221
|
export {
|
|
136
222
|
type InvocationCreateResponse as InvocationCreateResponse,
|
|
137
223
|
type InvocationRetrieveResponse as InvocationRetrieveResponse,
|
|
224
|
+
type InvocationUpdateResponse as InvocationUpdateResponse,
|
|
138
225
|
type InvocationCreateParams as InvocationCreateParams,
|
|
226
|
+
type InvocationUpdateParams as InvocationUpdateParams,
|
|
139
227
|
};
|
|
140
228
|
}
|
|
@@ -9,7 +9,7 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
|
|
10
10
|
export class Browsers extends APIResource {
|
|
11
11
|
/**
|
|
12
|
-
* Create
|
|
12
|
+
* Create a new browser session from within an action.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
@@ -23,7 +23,7 @@ export class Browsers extends APIResource {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Get
|
|
26
|
+
* Get information about a browser session.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```ts
|
|
@@ -37,7 +37,7 @@ export class Browsers extends APIResource {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* List active browser sessions
|
|
40
|
+
* List active browser sessions
|
|
41
41
|
*
|
|
42
42
|
* @example
|
|
43
43
|
* ```ts
|
|
@@ -49,7 +49,7 @@ export class Browsers extends APIResource {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* Delete a persistent browser session by persistent_id
|
|
52
|
+
* Delete a persistent browser session by its persistent_id.
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
55
|
* ```ts
|
|
@@ -68,7 +68,7 @@ export class Browsers extends APIResource {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* Delete
|
|
71
|
+
* Delete a browser session by ID
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```ts
|
|
@@ -175,6 +175,12 @@ export interface BrowserCreateParams {
|
|
|
175
175
|
* Optional persistence configuration for the browser session.
|
|
176
176
|
*/
|
|
177
177
|
persistence?: BrowserPersistence;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* If true, launches the browser in stealth mode to reduce detection by anti-bot
|
|
181
|
+
* mechanisms.
|
|
182
|
+
*/
|
|
183
|
+
stealth?: boolean;
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
export interface BrowserDeleteParams {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.5.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.5.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shims for types that we can't always rely on being available globally.
|
|
5
|
-
*
|
|
6
|
-
* Note: these only exist at the type-level, there is no corresponding runtime
|
|
7
|
-
* version for any of these symbols.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* In order to properly access the global `NodeJS` type, if it's available, we
|
|
12
|
-
* need to make use of declaration shadowing. Without this, any checks for the
|
|
13
|
-
* presence of `NodeJS.ReadableStream` will fail.
|
|
14
|
-
*/
|
|
15
|
-
declare namespace NodeJS {
|
|
16
|
-
interface ReadableStream {}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
type HasProperties<T> = keyof T extends never ? false : true;
|
|
20
|
-
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
type _ReadableStream<R = any> =
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
HasProperties<NodeJS.ReadableStream> extends true ? NodeJS.ReadableStream<R> : ReadableStream<R>;
|
|
25
|
-
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream;
|
|
28
|
-
export { _ReadableStream as ReadableStream };
|