@onkernel/sdk 0.4.0 → 0.6.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 (159) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +24 -36
  3. package/client.d.mts +15 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +15 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +31 -22
  8. package/client.js.map +1 -1
  9. package/client.mjs +20 -11
  10. package/client.mjs.map +1 -1
  11. package/core/resource.d.mts +1 -1
  12. package/core/resource.d.mts.map +1 -1
  13. package/core/resource.d.ts +1 -1
  14. package/core/resource.d.ts.map +1 -1
  15. package/core/resource.js.map +1 -1
  16. package/core/resource.mjs.map +1 -1
  17. package/internal/detect-platform.js +3 -3
  18. package/internal/detect-platform.js.map +1 -1
  19. package/internal/detect-platform.mjs +3 -3
  20. package/internal/detect-platform.mjs.map +1 -1
  21. package/internal/headers.d.mts.map +1 -1
  22. package/internal/headers.d.ts.map +1 -1
  23. package/internal/headers.js +4 -4
  24. package/internal/headers.js.map +1 -1
  25. package/internal/headers.mjs +4 -4
  26. package/internal/headers.mjs.map +1 -1
  27. package/internal/request-options.d.mts +1 -0
  28. package/internal/request-options.d.mts.map +1 -1
  29. package/internal/request-options.d.ts +1 -0
  30. package/internal/request-options.d.ts.map +1 -1
  31. package/internal/request-options.js.map +1 -1
  32. package/internal/request-options.mjs.map +1 -1
  33. package/internal/shim-types.d.mts +11 -22
  34. package/internal/shim-types.d.mts.map +1 -0
  35. package/internal/shim-types.d.ts +11 -22
  36. package/internal/shim-types.d.ts.map +1 -0
  37. package/internal/shim-types.js +4 -0
  38. package/internal/shim-types.js.map +1 -0
  39. package/internal/shim-types.mjs +3 -0
  40. package/internal/shim-types.mjs.map +1 -0
  41. package/internal/shims.d.mts +2 -2
  42. package/internal/shims.d.mts.map +1 -1
  43. package/internal/shims.d.ts +2 -2
  44. package/internal/shims.d.ts.map +1 -1
  45. package/internal/uploads.js +1 -1
  46. package/internal/uploads.js.map +1 -1
  47. package/internal/uploads.mjs +1 -1
  48. package/internal/uploads.mjs.map +1 -1
  49. package/internal/utils/log.js +1 -1
  50. package/internal/utils/log.js.map +1 -1
  51. package/internal/utils/log.mjs +1 -1
  52. package/internal/utils/log.mjs.map +1 -1
  53. package/internal/utils/path.d.mts.map +1 -1
  54. package/internal/utils/path.d.ts.map +1 -1
  55. package/internal/utils/path.js.map +1 -1
  56. package/internal/utils/path.mjs +1 -1
  57. package/internal/utils/path.mjs.map +1 -1
  58. package/internal/utils/values.d.mts +2 -0
  59. package/internal/utils/values.d.mts.map +1 -1
  60. package/internal/utils/values.d.ts +2 -0
  61. package/internal/utils/values.d.ts.map +1 -1
  62. package/internal/utils/values.js +4 -1
  63. package/internal/utils/values.js.map +1 -1
  64. package/internal/utils/values.mjs +2 -0
  65. package/internal/utils/values.mjs.map +1 -1
  66. package/package.json +1 -4
  67. package/resources/apps/apps.d.mts +2 -7
  68. package/resources/apps/apps.d.mts.map +1 -1
  69. package/resources/apps/apps.d.ts +2 -7
  70. package/resources/apps/apps.d.ts.map +1 -1
  71. package/resources/apps/apps.js +1 -6
  72. package/resources/apps/apps.js.map +1 -1
  73. package/resources/apps/apps.mjs +1 -6
  74. package/resources/apps/apps.mjs.map +1 -1
  75. package/resources/apps/deployments.d.mts +3 -19
  76. package/resources/apps/deployments.d.mts.map +1 -1
  77. package/resources/apps/deployments.d.ts +3 -19
  78. package/resources/apps/deployments.d.ts.map +1 -1
  79. package/resources/apps/deployments.js +1 -1
  80. package/resources/apps/deployments.js.map +1 -1
  81. package/resources/apps/deployments.mjs +1 -1
  82. package/resources/apps/deployments.mjs.map +1 -1
  83. package/resources/apps/index.d.mts +0 -1
  84. package/resources/apps/index.d.mts.map +1 -1
  85. package/resources/apps/index.d.ts +0 -1
  86. package/resources/apps/index.d.ts.map +1 -1
  87. package/resources/apps/index.js +1 -3
  88. package/resources/apps/index.js.map +1 -1
  89. package/resources/apps/index.mjs +0 -1
  90. package/resources/apps/index.mjs.map +1 -1
  91. package/resources/browsers.d.mts +10 -5
  92. package/resources/browsers.d.mts.map +1 -1
  93. package/resources/browsers.d.ts +10 -5
  94. package/resources/browsers.d.ts.map +1 -1
  95. package/resources/browsers.js +5 -5
  96. package/resources/browsers.mjs +5 -5
  97. package/resources/deployments.d.mts +255 -0
  98. package/resources/deployments.d.mts.map +1 -0
  99. package/resources/deployments.d.ts +255 -0
  100. package/resources/deployments.d.ts.map +1 -0
  101. package/resources/deployments.js +54 -0
  102. package/resources/deployments.js.map +1 -0
  103. package/resources/deployments.mjs +50 -0
  104. package/resources/deployments.mjs.map +1 -0
  105. package/resources/index.d.mts +3 -0
  106. package/resources/index.d.mts.map +1 -1
  107. package/resources/index.d.ts +3 -0
  108. package/resources/index.d.ts.map +1 -1
  109. package/resources/index.js +7 -1
  110. package/resources/index.js.map +1 -1
  111. package/resources/index.mjs +3 -0
  112. package/resources/index.mjs.map +1 -1
  113. package/resources/{apps/invocations.d.mts → invocations.d.mts} +85 -13
  114. package/resources/invocations.d.mts.map +1 -0
  115. package/resources/{apps/invocations.d.ts → invocations.d.ts} +85 -13
  116. package/resources/invocations.d.ts.map +1 -0
  117. package/resources/invocations.js +69 -0
  118. package/resources/invocations.js.map +1 -0
  119. package/resources/invocations.mjs +65 -0
  120. package/resources/invocations.mjs.map +1 -0
  121. package/resources/shared.d.mts +57 -0
  122. package/resources/shared.d.mts.map +1 -0
  123. package/resources/shared.d.ts +57 -0
  124. package/resources/shared.d.ts.map +1 -0
  125. package/resources/shared.js +4 -0
  126. package/resources/shared.js.map +1 -0
  127. package/resources/shared.mjs +3 -0
  128. package/resources/shared.mjs.map +1 -0
  129. package/src/client.ts +75 -11
  130. package/src/core/resource.ts +1 -1
  131. package/src/internal/detect-platform.ts +3 -3
  132. package/src/internal/headers.ts +5 -5
  133. package/src/internal/request-options.ts +1 -0
  134. package/src/internal/shim-types.ts +26 -0
  135. package/src/internal/shims.ts +2 -2
  136. package/src/internal/uploads.ts +2 -2
  137. package/src/internal/utils/log.ts +1 -1
  138. package/src/internal/utils/path.ts +1 -1
  139. package/src/internal/utils/values.ts +3 -0
  140. package/src/resources/apps/apps.ts +2 -23
  141. package/src/resources/apps/deployments.ts +3 -22
  142. package/src/resources/apps/index.ts +0 -8
  143. package/src/resources/browsers.ts +11 -5
  144. package/src/resources/deployments.ts +326 -0
  145. package/src/resources/index.ts +19 -0
  146. package/src/resources/{apps/invocations.ts → invocations.ts} +108 -13
  147. package/src/resources/shared.ts +69 -0
  148. package/src/version.ts +1 -1
  149. package/version.d.mts +1 -1
  150. package/version.d.ts +1 -1
  151. package/version.js +1 -1
  152. package/version.mjs +1 -1
  153. package/resources/apps/invocations.d.mts.map +0 -1
  154. package/resources/apps/invocations.d.ts.map +0 -1
  155. package/resources/apps/invocations.js +0 -52
  156. package/resources/apps/invocations.js.map +0 -1
  157. package/resources/apps/invocations.mjs +0 -48
  158. package/resources/apps/invocations.mjs.map +0 -1
  159. package/src/internal/shim-types.d.ts +0 -28
@@ -0,0 +1,26 @@
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
+ type NeverToAny<T> = T extends never ? any : T;
11
+
12
+ /** @ts-ignore */
13
+ type _DOMReadableStream<R = any> = globalThis.ReadableStream<R>;
14
+
15
+ /** @ts-ignore */
16
+ type _NodeReadableStream<R = any> = import('stream/web').ReadableStream<R>;
17
+
18
+ type _ConditionalNodeReadableStream<R = any> =
19
+ typeof globalThis extends { ReadableStream: any } ? never : _NodeReadableStream<R>;
20
+
21
+ type _ReadableStream<R = any> = NeverToAny<
22
+ | ([0] extends [1 & _DOMReadableStream<R>] ? never : _DOMReadableStream<R>)
23
+ | ([0] extends [1 & _ConditionalNodeReadableStream<R>] ? never : _ConditionalNodeReadableStream<R>)
24
+ >;
25
+
26
+ export type { _ReadableStream as ReadableStream };
@@ -7,8 +7,8 @@
7
7
  * messages in cases where an environment isn't fully supported.
8
8
  */
9
9
 
10
- import { type Fetch } from './builtin-types';
11
- import { type ReadableStream } from './shim-types';
10
+ import type { Fetch } from './builtin-types';
11
+ import type { ReadableStream } from './shim-types';
12
12
 
13
13
  export function getDefaultFetch(): Fetch {
14
14
  if (typeof fetch !== 'undefined') {
@@ -90,7 +90,7 @@ export const multipartFormRequestOptions = async (
90
90
  return { ...opts, body: await createForm(opts.body, fetch) };
91
91
  };
92
92
 
93
- const supportsFormDataMap = new WeakMap<Fetch, Promise<boolean>>();
93
+ const supportsFormDataMap = /** @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>();
94
94
 
95
95
  /**
96
96
  * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
@@ -138,7 +138,7 @@ export const createForm = async <T = Record<string, unknown>>(
138
138
 
139
139
  // We check for Blob not File because Bun.File doesn't inherit from File,
140
140
  // but they both inherit from Blob and have a `name` property at runtime.
141
- const isNamedBlob = (value: object) => value instanceof Blob && 'name' in value;
141
+ const isNamedBlob = (value: unknown) => value instanceof Blob && 'name' in value;
142
142
 
143
143
  const isUploadable = (value: unknown) =>
144
144
  typeof value === 'object' &&
@@ -58,7 +58,7 @@ const noopLogger = {
58
58
  debug: noop,
59
59
  };
60
60
 
61
- let cachedLoggers = new WeakMap<Logger, [LogLevel, Logger]>();
61
+ let cachedLoggers = /** @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
62
62
 
63
63
  export function loggerFor(client: Kernel): Logger {
64
64
  const logger = client.logger;
@@ -60,4 +60,4 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
60
60
  /**
61
61
  * URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
62
62
  */
63
- export const path = createPathTagFunction(encodeURIPath);
63
+ export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
@@ -9,6 +9,9 @@ export const isAbsoluteURL = (url: string): boolean => {
9
9
  return startsWithSchemeRegexp.test(url);
10
10
  };
11
11
 
12
+ export let isArray = (val: unknown): val is unknown[] => ((isArray = Array.isArray), isArray(val));
13
+ export let isReadonlyArray = isArray as (val: unknown) => val is readonly unknown[];
14
+
12
15
  /** Returns an object if the given value isn't an object, otherwise returns as-is */
13
16
  export function maybeObj(x: unknown): object {
14
17
  if (typeof x !== 'object') {
@@ -8,25 +8,14 @@ import {
8
8
  DeploymentFollowResponse,
9
9
  Deployments,
10
10
  } from './deployments';
11
- import * as InvocationsAPI from './invocations';
12
- import {
13
- InvocationCreateParams,
14
- InvocationCreateResponse,
15
- InvocationRetrieveResponse,
16
- InvocationUpdateParams,
17
- InvocationUpdateResponse,
18
- Invocations,
19
- } from './invocations';
20
11
  import { APIPromise } from '../../core/api-promise';
21
12
  import { RequestOptions } from '../../internal/request-options';
22
13
 
23
14
  export class Apps extends APIResource {
24
15
  deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client);
25
- invocations: InvocationsAPI.Invocations = new InvocationsAPI.Invocations(this._client);
26
16
 
27
17
  /**
28
- * List application versions for the authenticated user. Optionally filter by app
29
- * name and/or version label.
18
+ * List applications. Optionally filter by app name and/or version label.
30
19
  *
31
20
  * @example
32
21
  * ```ts
@@ -58,7 +47,7 @@ export namespace AppListResponse {
58
47
  /**
59
48
  * Deployment region code
60
49
  */
61
- region: string;
50
+ region: 'aws.us-east-1a';
62
51
 
63
52
  /**
64
53
  * Version label for the application
@@ -85,7 +74,6 @@ export interface AppListParams {
85
74
  }
86
75
 
87
76
  Apps.Deployments = Deployments;
88
- Apps.Invocations = Invocations;
89
77
 
90
78
  export declare namespace Apps {
91
79
  export { type AppListResponse as AppListResponse, type AppListParams as AppListParams };
@@ -96,13 +84,4 @@ export declare namespace Apps {
96
84
  type DeploymentFollowResponse as DeploymentFollowResponse,
97
85
  type DeploymentCreateParams as DeploymentCreateParams,
98
86
  };
99
-
100
- export {
101
- Invocations as Invocations,
102
- type InvocationCreateResponse as InvocationCreateResponse,
103
- type InvocationRetrieveResponse as InvocationRetrieveResponse,
104
- type InvocationUpdateResponse as InvocationUpdateResponse,
105
- type InvocationCreateParams as InvocationCreateParams,
106
- type InvocationUpdateParams as InvocationUpdateParams,
107
- };
108
87
  }
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as Shared from '../shared';
4
5
  import { APIPromise } from '../../core/api-promise';
5
6
  import { Stream } from '../../core/streaming';
6
7
  import { type Uploadable } from '../../core/uploads';
@@ -11,7 +12,7 @@ import { path } from '../../internal/utils/path';
11
12
 
12
13
  export class Deployments extends APIResource {
13
14
  /**
14
- * Deploy a new application
15
+ * Deploy a new application and associated actions to Kernel.
15
16
  *
16
17
  * @example
17
18
  * ```ts
@@ -96,7 +97,7 @@ export namespace DeploymentCreateResponse {
96
97
  export type DeploymentFollowResponse =
97
98
  | DeploymentFollowResponse.StateEvent
98
99
  | DeploymentFollowResponse.StateUpdateEvent
99
- | DeploymentFollowResponse.LogEvent;
100
+ | Shared.LogEvent;
100
101
 
101
102
  export namespace DeploymentFollowResponse {
102
103
  /**
@@ -138,26 +139,6 @@ export namespace DeploymentFollowResponse {
138
139
  */
139
140
  timestamp?: string;
140
141
  }
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
142
  }
162
143
 
163
144
  export interface DeploymentCreateParams {
@@ -7,11 +7,3 @@ export {
7
7
  type DeploymentFollowResponse,
8
8
  type DeploymentCreateParams,
9
9
  } from './deployments';
10
- export {
11
- Invocations,
12
- type InvocationCreateResponse,
13
- type InvocationRetrieveResponse,
14
- type InvocationUpdateResponse,
15
- type InvocationCreateParams,
16
- type InvocationUpdateParams,
17
- } from './invocations';
@@ -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 {
@@ -0,0 +1,326 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as Shared from './shared';
5
+ import { APIPromise } from '../core/api-promise';
6
+ import { Stream } from '../core/streaming';
7
+ import { type Uploadable } from '../core/uploads';
8
+ import { buildHeaders } from '../internal/headers';
9
+ import { RequestOptions } from '../internal/request-options';
10
+ import { multipartFormRequestOptions } from '../internal/uploads';
11
+ import { path } from '../internal/utils/path';
12
+
13
+ export class Deployments extends APIResource {
14
+ /**
15
+ * Create a new deployment.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const deployment = await client.deployments.create({
20
+ * entrypoint_rel_path: 'src/app.py',
21
+ * file: fs.createReadStream('path/to/file'),
22
+ * });
23
+ * ```
24
+ */
25
+ create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse> {
26
+ return this._client.post('/deployments', multipartFormRequestOptions({ body, ...options }, this._client));
27
+ }
28
+
29
+ /**
30
+ * Get information about a deployment's status.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const deployment = await client.deployments.retrieve('id');
35
+ * ```
36
+ */
37
+ retrieve(id: string, options?: RequestOptions): APIPromise<DeploymentRetrieveResponse> {
38
+ return this._client.get(path`/deployments/${id}`, options);
39
+ }
40
+
41
+ /**
42
+ * Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
43
+ * status updates for a deployment. The stream terminates automatically once the
44
+ * deployment reaches a terminal state.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const response = await client.deployments.follow('id');
49
+ * ```
50
+ */
51
+ follow(id: string, options?: RequestOptions): APIPromise<Stream<DeploymentFollowResponse>> {
52
+ return this._client.get(path`/deployments/${id}/events`, {
53
+ ...options,
54
+ headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
55
+ stream: true,
56
+ }) as APIPromise<Stream<DeploymentFollowResponse>>;
57
+ }
58
+ }
59
+
60
+ /**
61
+ * An event representing the current state of a deployment.
62
+ */
63
+ export interface DeploymentStateEvent {
64
+ /**
65
+ * Deployment record information.
66
+ */
67
+ deployment: DeploymentStateEvent.Deployment;
68
+
69
+ /**
70
+ * Event type identifier (always "deployment_state").
71
+ */
72
+ event: 'deployment_state';
73
+
74
+ /**
75
+ * Time the state was reported.
76
+ */
77
+ timestamp: string;
78
+ }
79
+
80
+ export namespace DeploymentStateEvent {
81
+ /**
82
+ * Deployment record information.
83
+ */
84
+ export interface Deployment {
85
+ /**
86
+ * Unique identifier for the deployment
87
+ */
88
+ id: string;
89
+
90
+ /**
91
+ * Timestamp when the deployment was created
92
+ */
93
+ created_at: string;
94
+
95
+ /**
96
+ * Deployment region code
97
+ */
98
+ region: 'aws.us-east-1a';
99
+
100
+ /**
101
+ * Current status of the deployment
102
+ */
103
+ status: 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped';
104
+
105
+ /**
106
+ * Relative path to the application entrypoint
107
+ */
108
+ entrypoint_rel_path?: string;
109
+
110
+ /**
111
+ * Environment variables configured for this deployment
112
+ */
113
+ env_vars?: Record<string, string>;
114
+
115
+ /**
116
+ * Status reason
117
+ */
118
+ status_reason?: string;
119
+
120
+ /**
121
+ * Timestamp when the deployment was last updated
122
+ */
123
+ updated_at?: string | null;
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Deployment record information.
129
+ */
130
+ export interface DeploymentCreateResponse {
131
+ /**
132
+ * Unique identifier for the deployment
133
+ */
134
+ id: string;
135
+
136
+ /**
137
+ * Timestamp when the deployment was created
138
+ */
139
+ created_at: string;
140
+
141
+ /**
142
+ * Deployment region code
143
+ */
144
+ region: 'aws.us-east-1a';
145
+
146
+ /**
147
+ * Current status of the deployment
148
+ */
149
+ status: 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped';
150
+
151
+ /**
152
+ * Relative path to the application entrypoint
153
+ */
154
+ entrypoint_rel_path?: string;
155
+
156
+ /**
157
+ * Environment variables configured for this deployment
158
+ */
159
+ env_vars?: Record<string, string>;
160
+
161
+ /**
162
+ * Status reason
163
+ */
164
+ status_reason?: string;
165
+
166
+ /**
167
+ * Timestamp when the deployment was last updated
168
+ */
169
+ updated_at?: string | null;
170
+ }
171
+
172
+ /**
173
+ * Deployment record information.
174
+ */
175
+ export interface DeploymentRetrieveResponse {
176
+ /**
177
+ * Unique identifier for the deployment
178
+ */
179
+ id: string;
180
+
181
+ /**
182
+ * Timestamp when the deployment was created
183
+ */
184
+ created_at: string;
185
+
186
+ /**
187
+ * Deployment region code
188
+ */
189
+ region: 'aws.us-east-1a';
190
+
191
+ /**
192
+ * Current status of the deployment
193
+ */
194
+ status: 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped';
195
+
196
+ /**
197
+ * Relative path to the application entrypoint
198
+ */
199
+ entrypoint_rel_path?: string;
200
+
201
+ /**
202
+ * Environment variables configured for this deployment
203
+ */
204
+ env_vars?: Record<string, string>;
205
+
206
+ /**
207
+ * Status reason
208
+ */
209
+ status_reason?: string;
210
+
211
+ /**
212
+ * Timestamp when the deployment was last updated
213
+ */
214
+ updated_at?: string | null;
215
+ }
216
+
217
+ /**
218
+ * Union type representing any deployment event.
219
+ */
220
+ export type DeploymentFollowResponse =
221
+ | Shared.LogEvent
222
+ | DeploymentStateEvent
223
+ | DeploymentFollowResponse.AppVersionSummaryEvent
224
+ | Shared.ErrorEvent;
225
+
226
+ export namespace DeploymentFollowResponse {
227
+ /**
228
+ * Summary of an application version.
229
+ */
230
+ export interface AppVersionSummaryEvent {
231
+ /**
232
+ * Unique identifier for the app version
233
+ */
234
+ id: string;
235
+
236
+ /**
237
+ * List of actions available on the app
238
+ */
239
+ actions: Array<AppVersionSummaryEvent.Action>;
240
+
241
+ /**
242
+ * Name of the application
243
+ */
244
+ app_name: string;
245
+
246
+ /**
247
+ * Event type identifier (always "app_version_summary").
248
+ */
249
+ event: 'app_version_summary';
250
+
251
+ /**
252
+ * Deployment region code
253
+ */
254
+ region: 'aws.us-east-1a';
255
+
256
+ /**
257
+ * Time the state was reported.
258
+ */
259
+ timestamp: string;
260
+
261
+ /**
262
+ * Version label for the application
263
+ */
264
+ version: string;
265
+
266
+ /**
267
+ * Environment variables configured for this app version
268
+ */
269
+ env_vars?: Record<string, string>;
270
+ }
271
+
272
+ export namespace AppVersionSummaryEvent {
273
+ /**
274
+ * An action available on the app
275
+ */
276
+ export interface Action {
277
+ /**
278
+ * Name of the action
279
+ */
280
+ name: string;
281
+ }
282
+ }
283
+ }
284
+
285
+ export interface DeploymentCreateParams {
286
+ /**
287
+ * Relative path to the entrypoint of the application
288
+ */
289
+ entrypoint_rel_path: string;
290
+
291
+ /**
292
+ * ZIP file containing the application source directory
293
+ */
294
+ file: Uploadable;
295
+
296
+ /**
297
+ * Map of environment variables to set for the deployed application. Each key-value
298
+ * pair represents an environment variable.
299
+ */
300
+ env_vars?: Record<string, string>;
301
+
302
+ /**
303
+ * Allow overwriting an existing app version
304
+ */
305
+ force?: boolean;
306
+
307
+ /**
308
+ * Region for deployment. Currently we only support "aws.us-east-1a"
309
+ */
310
+ region?: 'aws.us-east-1a';
311
+
312
+ /**
313
+ * Version of the application. Can be any string.
314
+ */
315
+ version?: string;
316
+ }
317
+
318
+ export declare namespace Deployments {
319
+ export {
320
+ type DeploymentStateEvent as DeploymentStateEvent,
321
+ type DeploymentCreateResponse as DeploymentCreateResponse,
322
+ type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
323
+ type DeploymentFollowResponse as DeploymentFollowResponse,
324
+ type DeploymentCreateParams as DeploymentCreateParams,
325
+ };
326
+ }
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ export * from './shared';
3
4
  export { Apps, type AppListResponse, type AppListParams } from './apps/apps';
4
5
  export {
5
6
  Browsers,
@@ -10,3 +11,21 @@ export {
10
11
  type BrowserCreateParams,
11
12
  type BrowserDeleteParams,
12
13
  } from './browsers';
14
+ export {
15
+ Deployments,
16
+ type DeploymentStateEvent,
17
+ type DeploymentCreateResponse,
18
+ type DeploymentRetrieveResponse,
19
+ type DeploymentFollowResponse,
20
+ type DeploymentCreateParams,
21
+ } from './deployments';
22
+ export {
23
+ Invocations,
24
+ type InvocationStateEvent,
25
+ type InvocationCreateResponse,
26
+ type InvocationRetrieveResponse,
27
+ type InvocationUpdateResponse,
28
+ type InvocationFollowResponse,
29
+ type InvocationCreateParams,
30
+ type InvocationUpdateParams,
31
+ } from './invocations';