@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.
Files changed (65) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +23 -35
  3. package/internal/detect-platform.js +3 -3
  4. package/internal/detect-platform.js.map +1 -1
  5. package/internal/detect-platform.mjs +3 -3
  6. package/internal/detect-platform.mjs.map +1 -1
  7. package/internal/shim-types.d.mts +11 -22
  8. package/internal/shim-types.d.mts.map +1 -0
  9. package/internal/shim-types.d.ts +11 -22
  10. package/internal/shim-types.d.ts.map +1 -0
  11. package/internal/shim-types.js +4 -0
  12. package/internal/shim-types.js.map +1 -0
  13. package/internal/shim-types.mjs +3 -0
  14. package/internal/shim-types.mjs.map +1 -0
  15. package/internal/shims.d.mts +2 -2
  16. package/internal/shims.d.mts.map +1 -1
  17. package/internal/shims.d.ts +2 -2
  18. package/internal/shims.d.ts.map +1 -1
  19. package/package.json +1 -4
  20. package/resources/apps/apps.d.mts +3 -4
  21. package/resources/apps/apps.d.mts.map +1 -1
  22. package/resources/apps/apps.d.ts +3 -4
  23. package/resources/apps/apps.d.ts.map +1 -1
  24. package/resources/apps/apps.js +1 -2
  25. package/resources/apps/apps.js.map +1 -1
  26. package/resources/apps/apps.mjs +1 -2
  27. package/resources/apps/apps.mjs.map +1 -1
  28. package/resources/apps/deployments.d.mts +1 -1
  29. package/resources/apps/deployments.d.ts +1 -1
  30. package/resources/apps/deployments.js +1 -1
  31. package/resources/apps/deployments.mjs +1 -1
  32. package/resources/apps/index.d.mts +1 -1
  33. package/resources/apps/index.d.mts.map +1 -1
  34. package/resources/apps/index.d.ts +1 -1
  35. package/resources/apps/index.d.ts.map +1 -1
  36. package/resources/apps/index.js.map +1 -1
  37. package/resources/apps/index.mjs.map +1 -1
  38. package/resources/apps/invocations.d.mts +70 -3
  39. package/resources/apps/invocations.d.mts.map +1 -1
  40. package/resources/apps/invocations.d.ts +70 -3
  41. package/resources/apps/invocations.d.ts.map +1 -1
  42. package/resources/apps/invocations.js +16 -2
  43. package/resources/apps/invocations.js.map +1 -1
  44. package/resources/apps/invocations.mjs +16 -2
  45. package/resources/apps/invocations.mjs.map +1 -1
  46. package/resources/browsers.d.mts +10 -5
  47. package/resources/browsers.d.mts.map +1 -1
  48. package/resources/browsers.d.ts +10 -5
  49. package/resources/browsers.d.ts.map +1 -1
  50. package/resources/browsers.js +5 -5
  51. package/resources/browsers.mjs +5 -5
  52. package/src/internal/detect-platform.ts +3 -3
  53. package/src/internal/shim-types.ts +26 -0
  54. package/src/internal/shims.ts +2 -2
  55. package/src/resources/apps/apps.ts +5 -2
  56. package/src/resources/apps/deployments.ts +1 -1
  57. package/src/resources/apps/index.ts +2 -0
  58. package/src/resources/apps/invocations.ts +90 -2
  59. package/src/resources/browsers.ts +11 -5
  60. package/src/version.ts +1 -1
  61. package/version.d.mts +1 -1
  62. package/version.d.ts +1 -1
  63. package/version.js +1 -1
  64. package/version.mjs +1 -1
  65. 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 application
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 app invocation by id
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 Browser Session
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 Browser Session by ID
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 for the authenticated user
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 query parameter.
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 Browser Session by ID
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.3.0'; // x-release-please-version
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.3.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.3.0";
1
+ export declare const VERSION = "0.5.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.3.0'; // x-release-please-version
4
+ exports.VERSION = '0.5.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.0'; // x-release-please-version
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 };