@onkernel/sdk 0.1.0-alpha.9 → 0.1.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 +72 -0
- package/README.md +42 -29
- package/client.d.mts +5 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -5
- package/client.d.ts.map +1 -1
- package/client.js +4 -4
- package/client.js.map +1 -1
- package/client.mjs +4 -4
- package/client.mjs.map +1 -1
- package/core/app-framework.d.mts +3 -3
- package/core/app-framework.d.mts.map +1 -1
- package/core/app-framework.d.ts +3 -3
- package/core/app-framework.d.ts.map +1 -1
- package/core/app-framework.js +14 -31
- package/core/app-framework.js.map +1 -1
- package/core/app-framework.mjs +14 -31
- package/core/app-framework.mjs.map +1 -1
- package/core/streaming.d.mts +31 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +31 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +257 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +252 -0
- package/core/streaming.mjs.map +1 -0
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +10 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +10 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +2 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +2 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/package.json +11 -4
- package/resources/apps/apps.d.mts +65 -0
- package/resources/apps/apps.d.mts.map +1 -0
- package/resources/apps/apps.d.ts +65 -0
- package/resources/apps/apps.d.ts.map +1 -0
- package/resources/apps/apps.js +33 -0
- package/resources/apps/apps.js.map +1 -0
- package/resources/apps/apps.mjs +28 -0
- package/resources/apps/apps.mjs.map +1 -0
- package/resources/apps/deployments.d.mts +157 -0
- package/resources/apps/deployments.d.mts.map +1 -0
- package/resources/apps/deployments.d.ts +157 -0
- package/resources/apps/deployments.d.ts.map +1 -0
- package/resources/apps/deployments.js +43 -0
- package/resources/apps/deployments.js.map +1 -0
- package/resources/apps/deployments.mjs +39 -0
- package/resources/apps/deployments.mjs.map +1 -0
- package/resources/apps/index.d.mts +4 -0
- package/resources/apps/index.d.mts.map +1 -0
- package/resources/apps/index.d.ts +4 -0
- package/resources/apps/index.d.ts.map +1 -0
- package/resources/apps/index.js +11 -0
- package/resources/apps/index.js.map +1 -0
- package/resources/apps/index.mjs +5 -0
- package/resources/apps/index.mjs.map +1 -0
- package/resources/apps/invocations.d.mts +110 -0
- package/resources/apps/invocations.d.mts.map +1 -0
- package/resources/apps/invocations.d.ts +110 -0
- package/resources/apps/invocations.d.ts.map +1 -0
- package/resources/apps/invocations.js +38 -0
- package/resources/apps/invocations.js.map +1 -0
- package/resources/apps/invocations.mjs +34 -0
- package/resources/apps/invocations.mjs.map +1 -0
- package/resources/apps.d.mts +1 -140
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +1 -140
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js +2 -49
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs +1 -47
- package/resources/apps.mjs.map +1 -1
- package/resources/browsers.d.mts +65 -0
- package/resources/browsers.d.mts.map +1 -0
- package/resources/browsers.d.ts +65 -0
- package/resources/browsers.d.ts.map +1 -0
- package/resources/browsers.js +36 -0
- package/resources/browsers.js.map +1 -0
- package/resources/browsers.mjs +32 -0
- package/resources/browsers.mjs.map +1 -0
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +13 -21
- package/src/core/app-framework.ts +19 -36
- package/src/core/streaming.ts +301 -0
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/parse.ts +14 -0
- package/src/internal/request-options.ts +2 -0
- package/src/resources/apps/apps.ts +104 -0
- package/src/resources/apps/deployments.ts +202 -0
- package/src/resources/apps/index.ts +15 -0
- package/src/resources/apps/invocations.ts +140 -0
- package/src/resources/apps.ts +1 -184
- package/src/resources/browsers.ts +85 -0
- package/src/resources/index.ts +6 -8
- package/src/streaming.ts +2 -0
- package/src/version.ts +1 -1
- package/streaming.d.mts +2 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +2 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +6 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +2 -0
- package/streaming.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/browser.d.mts +0 -33
- package/resources/browser.d.mts.map +0 -1
- package/resources/browser.d.ts +0 -33
- package/resources/browser.d.ts.map +0 -1
- package/resources/browser.js +0 -15
- package/resources/browser.js.map +0 -1
- package/resources/browser.mjs +0 -11
- package/resources/browser.mjs.map +0 -1
- package/src/resources/browser.ts +0 -48
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { Stream } from '../../core/streaming';
|
|
6
|
+
import { type Uploadable } from '../../core/uploads';
|
|
7
|
+
import { buildHeaders } from '../../internal/headers';
|
|
8
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
9
|
+
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
10
|
+
import { path } from '../../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
export class Deployments extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Deploy a new application
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const deployment = await client.apps.deployments.create({
|
|
19
|
+
* entrypoint_rel_path: 'src/app.py',
|
|
20
|
+
* file: fs.createReadStream('path/to/file'),
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse> {
|
|
25
|
+
return this._client.post('/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
|
|
30
|
+
* status updates for a deployed application. The stream terminates automatically
|
|
31
|
+
* once the application reaches a terminal state.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const response = await client.apps.deployments.follow('id');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
follow(id: string, options?: RequestOptions): APIPromise<Stream<DeploymentFollowResponse>> {
|
|
39
|
+
return this._client.get(path`/apps/${id}/events`, {
|
|
40
|
+
...options,
|
|
41
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
42
|
+
stream: true,
|
|
43
|
+
}) as APIPromise<Stream<DeploymentFollowResponse>>;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface DeploymentCreateResponse {
|
|
48
|
+
/**
|
|
49
|
+
* List of apps deployed
|
|
50
|
+
*/
|
|
51
|
+
apps: Array<DeploymentCreateResponse.App>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Current status of the deployment
|
|
55
|
+
*/
|
|
56
|
+
status: 'queued' | 'deploying' | 'succeeded' | 'failed';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Status reason
|
|
60
|
+
*/
|
|
61
|
+
status_reason?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export namespace DeploymentCreateResponse {
|
|
65
|
+
export interface App {
|
|
66
|
+
/**
|
|
67
|
+
* ID for the app version deployed
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* List of actions available on the app
|
|
73
|
+
*/
|
|
74
|
+
actions: Array<App.Action>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Name of the app
|
|
78
|
+
*/
|
|
79
|
+
name: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export namespace App {
|
|
83
|
+
export interface Action {
|
|
84
|
+
/**
|
|
85
|
+
* Name of the action
|
|
86
|
+
*/
|
|
87
|
+
name: string;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Union type representing any application event. Actual schema is determined by
|
|
94
|
+
* the 'event' field.
|
|
95
|
+
*/
|
|
96
|
+
export type DeploymentFollowResponse =
|
|
97
|
+
| DeploymentFollowResponse.StateEvent
|
|
98
|
+
| DeploymentFollowResponse.StateUpdateEvent
|
|
99
|
+
| DeploymentFollowResponse.LogEvent;
|
|
100
|
+
|
|
101
|
+
export namespace DeploymentFollowResponse {
|
|
102
|
+
/**
|
|
103
|
+
* Initial state of the application, emitted once when subscribing.
|
|
104
|
+
*/
|
|
105
|
+
export interface StateEvent {
|
|
106
|
+
/**
|
|
107
|
+
* Event type identifier (always "state").
|
|
108
|
+
*/
|
|
109
|
+
event: 'state';
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Current application state (e.g., "deploying", "running", "succeeded", "failed").
|
|
113
|
+
*/
|
|
114
|
+
state: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Time the state was reported.
|
|
118
|
+
*/
|
|
119
|
+
timestamp?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* An update emitted when the application's state changes.
|
|
124
|
+
*/
|
|
125
|
+
export interface StateUpdateEvent {
|
|
126
|
+
/**
|
|
127
|
+
* Event type identifier (always "state_update").
|
|
128
|
+
*/
|
|
129
|
+
event: 'state_update';
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* New application state (e.g., "running", "succeeded", "failed").
|
|
133
|
+
*/
|
|
134
|
+
state: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Time the state change occurred.
|
|
138
|
+
*/
|
|
139
|
+
timestamp?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* A log entry from the application.
|
|
144
|
+
*/
|
|
145
|
+
export interface LogEvent {
|
|
146
|
+
/**
|
|
147
|
+
* Event type identifier (always "log").
|
|
148
|
+
*/
|
|
149
|
+
event: 'log';
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Log message text.
|
|
153
|
+
*/
|
|
154
|
+
message: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Time the log entry was produced.
|
|
158
|
+
*/
|
|
159
|
+
timestamp?: string;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface DeploymentCreateParams {
|
|
164
|
+
/**
|
|
165
|
+
* Relative path to the entrypoint of the application
|
|
166
|
+
*/
|
|
167
|
+
entrypoint_rel_path: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* ZIP file containing the application source directory
|
|
171
|
+
*/
|
|
172
|
+
file: Uploadable;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Map of environment variables to set for the deployed application. Each key-value
|
|
176
|
+
* pair represents an environment variable.
|
|
177
|
+
*/
|
|
178
|
+
env_vars?: Record<string, string>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Allow overwriting an existing app version
|
|
182
|
+
*/
|
|
183
|
+
force?: boolean;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Region for deployment. Currently we only support "aws.us-east-1a"
|
|
187
|
+
*/
|
|
188
|
+
region?: 'aws.us-east-1a';
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Version of the application. Can be any string.
|
|
192
|
+
*/
|
|
193
|
+
version?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export declare namespace Deployments {
|
|
197
|
+
export {
|
|
198
|
+
type DeploymentCreateResponse as DeploymentCreateResponse,
|
|
199
|
+
type DeploymentFollowResponse as DeploymentFollowResponse,
|
|
200
|
+
type DeploymentCreateParams as DeploymentCreateParams,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Apps, type AppListResponse, type AppListParams } from './apps';
|
|
4
|
+
export {
|
|
5
|
+
Deployments,
|
|
6
|
+
type DeploymentCreateResponse,
|
|
7
|
+
type DeploymentFollowResponse,
|
|
8
|
+
type DeploymentCreateParams,
|
|
9
|
+
} from './deployments';
|
|
10
|
+
export {
|
|
11
|
+
Invocations,
|
|
12
|
+
type InvocationCreateResponse,
|
|
13
|
+
type InvocationRetrieveResponse,
|
|
14
|
+
type InvocationCreateParams,
|
|
15
|
+
} from './invocations';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Invocations extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Invoke an application
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const invocation = await client.apps.invocations.create({
|
|
15
|
+
* action_name: 'analyze',
|
|
16
|
+
* app_name: 'my-app',
|
|
17
|
+
* version: '1.0.0',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<InvocationCreateResponse> {
|
|
22
|
+
return this._client.post('/invocations', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get an app invocation by id
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const invocation = await client.apps.invocations.retrieve(
|
|
31
|
+
* 'ckqwer3o20000jb9s7abcdef',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse> {
|
|
36
|
+
return this._client.get(path`/invocations/${id}`, options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface InvocationCreateResponse {
|
|
41
|
+
/**
|
|
42
|
+
* ID of the invocation
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Status of the invocation
|
|
48
|
+
*/
|
|
49
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The return value of the action that was invoked, rendered as a JSON string. This
|
|
53
|
+
* could be: string, number, boolean, array, object, or null.
|
|
54
|
+
*/
|
|
55
|
+
output?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Status reason
|
|
59
|
+
*/
|
|
60
|
+
status_reason?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface InvocationRetrieveResponse {
|
|
64
|
+
/**
|
|
65
|
+
* ID of the invocation
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Name of the action invoked
|
|
71
|
+
*/
|
|
72
|
+
action_name: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Name of the application
|
|
76
|
+
*/
|
|
77
|
+
app_name: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* RFC 3339 Nanoseconds timestamp when the invocation started
|
|
81
|
+
*/
|
|
82
|
+
started_at: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Status of the invocation
|
|
86
|
+
*/
|
|
87
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
|
|
91
|
+
* running)
|
|
92
|
+
*/
|
|
93
|
+
finished_at?: string | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Output produced by the action, rendered as a JSON string. This could be: string,
|
|
97
|
+
* number, boolean, array, object, or null.
|
|
98
|
+
*/
|
|
99
|
+
output?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Payload provided to the invocation. This is a string that can be parsed as JSON.
|
|
103
|
+
*/
|
|
104
|
+
payload?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Status reason
|
|
108
|
+
*/
|
|
109
|
+
status_reason?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface InvocationCreateParams {
|
|
113
|
+
/**
|
|
114
|
+
* Name of the action to invoke
|
|
115
|
+
*/
|
|
116
|
+
action_name: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Name of the application
|
|
120
|
+
*/
|
|
121
|
+
app_name: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Version of the application
|
|
125
|
+
*/
|
|
126
|
+
version: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Input data for the action, sent as a JSON string.
|
|
130
|
+
*/
|
|
131
|
+
payload?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare namespace Invocations {
|
|
135
|
+
export {
|
|
136
|
+
type InvocationCreateResponse as InvocationCreateResponse,
|
|
137
|
+
type InvocationRetrieveResponse as InvocationRetrieveResponse,
|
|
138
|
+
type InvocationCreateParams as InvocationCreateParams,
|
|
139
|
+
};
|
|
140
|
+
}
|
package/src/resources/apps.ts
CHANGED
|
@@ -1,186 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { type Uploadable } from '../core/uploads';
|
|
6
|
-
import { RequestOptions } from '../internal/request-options';
|
|
7
|
-
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
8
|
-
import { path } from '../internal/utils/path';
|
|
9
|
-
|
|
10
|
-
export class Apps extends APIResource {
|
|
11
|
-
/**
|
|
12
|
-
* Deploy a new application
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const response = await client.apps.deploy({
|
|
17
|
-
* file: fs.createReadStream('path/to/file'),
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
deploy(body: AppDeployParams, options?: RequestOptions): APIPromise<AppDeployResponse> {
|
|
22
|
-
return this._client.post('/apps/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Invoke an application
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const response = await client.apps.invoke({
|
|
31
|
-
* actionName: 'analyze',
|
|
32
|
-
* appName: 'my-awesome-app',
|
|
33
|
-
* payload: { data: 'example input' },
|
|
34
|
-
* version: '1.0.0',
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
invoke(body: AppInvokeParams, options?: RequestOptions): APIPromise<AppInvokeResponse> {
|
|
39
|
-
return this._client.post('/apps/invoke', { body, ...options });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get an app invocation by id
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```ts
|
|
47
|
-
* const response = await client.apps.retrieveInvocation(
|
|
48
|
-
* 'ckqwer3o20000jb9s7abcdef',
|
|
49
|
-
* );
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
retrieveInvocation(id: string, options?: RequestOptions): APIPromise<AppRetrieveInvocationResponse> {
|
|
53
|
-
return this._client.get(path`/apps/invocations/${id}`, options);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface AppDeployResponse {
|
|
58
|
-
apps: Array<AppDeployResponse.App>;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Success message
|
|
62
|
-
*/
|
|
63
|
-
message: string;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Status of the deployment
|
|
67
|
-
*/
|
|
68
|
-
success: boolean;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export namespace AppDeployResponse {
|
|
72
|
-
export interface App {
|
|
73
|
-
/**
|
|
74
|
-
* ID for the app version deployed
|
|
75
|
-
*/
|
|
76
|
-
id: string;
|
|
77
|
-
|
|
78
|
-
actions: Array<App.Action>;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Name of the app
|
|
82
|
-
*/
|
|
83
|
-
name: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export namespace App {
|
|
87
|
-
export interface Action {
|
|
88
|
-
/**
|
|
89
|
-
* Name of the action
|
|
90
|
-
*/
|
|
91
|
-
name: string;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface AppInvokeResponse {
|
|
97
|
-
/**
|
|
98
|
-
* ID of the invocation
|
|
99
|
-
*/
|
|
100
|
-
id: string;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Status of the invocation
|
|
104
|
-
*/
|
|
105
|
-
status: 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED';
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Output from the invocation (if available)
|
|
109
|
-
*/
|
|
110
|
-
output?: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface AppRetrieveInvocationResponse {
|
|
114
|
-
id: string;
|
|
115
|
-
|
|
116
|
-
appName: string;
|
|
117
|
-
|
|
118
|
-
finishedAt: string | null;
|
|
119
|
-
|
|
120
|
-
input: string;
|
|
121
|
-
|
|
122
|
-
output: string;
|
|
123
|
-
|
|
124
|
-
startedAt: string;
|
|
125
|
-
|
|
126
|
-
status: string;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface AppDeployParams {
|
|
130
|
-
/**
|
|
131
|
-
* ZIP file containing the application source directory
|
|
132
|
-
*/
|
|
133
|
-
file: Uploadable;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Relative path to the entrypoint of the application
|
|
137
|
-
*/
|
|
138
|
-
entrypointRelPath?: string;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Allow overwriting an existing app version
|
|
142
|
-
*/
|
|
143
|
-
force?: 'true' | 'false';
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Region for deployment. Currently we only support "aws.us-east-1a"
|
|
147
|
-
*/
|
|
148
|
-
region?: 'aws.us-east-1a';
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Version of the application. Can be any string.
|
|
152
|
-
*/
|
|
153
|
-
version?: string;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface AppInvokeParams {
|
|
157
|
-
/**
|
|
158
|
-
* Name of the action to invoke
|
|
159
|
-
*/
|
|
160
|
-
actionName: string;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Name of the application
|
|
164
|
-
*/
|
|
165
|
-
appName: string;
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Input data for the application
|
|
169
|
-
*/
|
|
170
|
-
payload: unknown;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Version of the application
|
|
174
|
-
*/
|
|
175
|
-
version: string;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export declare namespace Apps {
|
|
179
|
-
export {
|
|
180
|
-
type AppDeployResponse as AppDeployResponse,
|
|
181
|
-
type AppInvokeResponse as AppInvokeResponse,
|
|
182
|
-
type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse,
|
|
183
|
-
type AppDeployParams as AppDeployParams,
|
|
184
|
-
type AppInvokeParams as AppInvokeParams,
|
|
185
|
-
};
|
|
186
|
-
}
|
|
3
|
+
export * from './apps/index';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Browsers extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create Browser Session
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const browser = await client.browsers.create({
|
|
15
|
+
* invocation_id: 'ckqwer3o20000jb9s7abcdef',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(body: BrowserCreateParams, options?: RequestOptions): APIPromise<BrowserCreateResponse> {
|
|
20
|
+
return this._client.post('/browsers', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get Browser Session by ID
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const browser = await client.browsers.retrieve(
|
|
29
|
+
* 'e5bf36fe-9247-4e2b-8b5a-2f594cc1c073',
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<BrowserRetrieveResponse> {
|
|
34
|
+
return this._client.get(path`/browsers/${id}`, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BrowserCreateResponse {
|
|
39
|
+
/**
|
|
40
|
+
* Remote URL for live viewing the browser session
|
|
41
|
+
*/
|
|
42
|
+
browser_live_view_url: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
46
|
+
*/
|
|
47
|
+
cdp_ws_url: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Unique identifier for the browser session
|
|
51
|
+
*/
|
|
52
|
+
session_id: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface BrowserRetrieveResponse {
|
|
56
|
+
/**
|
|
57
|
+
* Remote URL for live viewing the browser session
|
|
58
|
+
*/
|
|
59
|
+
browser_live_view_url: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
63
|
+
*/
|
|
64
|
+
cdp_ws_url: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Unique identifier for the browser session
|
|
68
|
+
*/
|
|
69
|
+
session_id: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface BrowserCreateParams {
|
|
73
|
+
/**
|
|
74
|
+
* action invocation ID
|
|
75
|
+
*/
|
|
76
|
+
invocation_id: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare namespace Browsers {
|
|
80
|
+
export {
|
|
81
|
+
type BrowserCreateResponse as BrowserCreateResponse,
|
|
82
|
+
type BrowserRetrieveResponse as BrowserRetrieveResponse,
|
|
83
|
+
type BrowserCreateParams as BrowserCreateParams,
|
|
84
|
+
};
|
|
85
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export { Apps, type AppListResponse, type AppListParams } from './apps/apps';
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
type AppInvokeParams,
|
|
10
|
-
} from './apps';
|
|
11
|
-
export { Browser, type BrowserCreateSessionResponse, type BrowserCreateSessionParams } from './browser';
|
|
5
|
+
Browsers,
|
|
6
|
+
type BrowserCreateResponse,
|
|
7
|
+
type BrowserRetrieveResponse,
|
|
8
|
+
type BrowserCreateParams,
|
|
9
|
+
} from './browsers';
|
package/src/streaming.ts
ADDED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0
|
|
1
|
+
export const VERSION = '0.1.0'; // x-release-please-version
|
package/streaming.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming.d.mts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
package/streaming.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
package/streaming.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/streaming instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/streaming.js"), exports);
|
|
6
|
+
//# sourceMappingURL=streaming.js.map
|
package/streaming.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,8DAAiC"}
|
package/streaming.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0
|
|
1
|
+
export declare const VERSION = "0.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|