@onkernel/sdk 0.1.0-alpha.12 → 0.1.0-alpha.13
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 +9 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/core/app-framework.d.mts +1 -1
- package/core/app-framework.d.mts.map +1 -1
- package/core/app-framework.d.ts +1 -1
- package/core/app-framework.d.ts.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/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/resources/apps/apps.d.mts +53 -2
- package/resources/apps/apps.d.mts.map +1 -1
- package/resources/apps/apps.d.ts +53 -2
- package/resources/apps/apps.d.ts.map +1 -1
- package/resources/apps/apps.js +12 -0
- package/resources/apps/apps.js.map +1 -1
- package/resources/apps/apps.mjs +13 -1
- package/resources/apps/apps.mjs.map +1 -1
- package/resources/apps/deployments.d.mts +70 -1
- package/resources/apps/deployments.d.mts.map +1 -1
- package/resources/apps/deployments.d.ts +70 -1
- package/resources/apps/deployments.d.ts.map +1 -1
- package/resources/apps/deployments.js +19 -0
- package/resources/apps/deployments.js.map +1 -1
- package/resources/apps/deployments.mjs +19 -0
- package/resources/apps/deployments.mjs.map +1 -1
- package/resources/apps/index.d.mts +2 -2
- package/resources/apps/index.d.mts.map +1 -1
- package/resources/apps/index.d.ts +2 -2
- package/resources/apps/index.d.ts.map +1 -1
- package/resources/apps/index.js.map +1 -1
- package/resources/apps/index.mjs +1 -1
- package/resources/apps/index.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +2 -2
- package/src/core/app-framework.ts +1 -1
- 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 +70 -1
- package/src/resources/apps/deployments.ts +93 -0
- package/src/resources/apps/index.ts +7 -2
- package/src/resources/index.ts +1 -1
- 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.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { Stream } from '../../core/streaming';
|
|
5
6
|
import { type Uploadable } from '../../core/uploads';
|
|
7
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
9
|
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
10
|
+
import { path } from '../../internal/utils/path';
|
|
8
11
|
|
|
9
12
|
export class Deployments extends APIResource {
|
|
10
13
|
/**
|
|
@@ -21,6 +24,24 @@ export class Deployments extends APIResource {
|
|
|
21
24
|
create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse> {
|
|
22
25
|
return this._client.post('/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
23
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
|
+
}
|
|
24
45
|
}
|
|
25
46
|
|
|
26
47
|
export interface DeploymentCreateResponse {
|
|
@@ -68,6 +89,77 @@ export namespace DeploymentCreateResponse {
|
|
|
68
89
|
}
|
|
69
90
|
}
|
|
70
91
|
|
|
92
|
+
/**
|
|
93
|
+
* A stream of application events (state updates and logs) in SSE format.
|
|
94
|
+
*/
|
|
95
|
+
export type DeploymentFollowResponse = Array<
|
|
96
|
+
| DeploymentFollowResponse.StateEvent
|
|
97
|
+
| DeploymentFollowResponse.StateUpdateEvent
|
|
98
|
+
| DeploymentFollowResponse.LogEvent
|
|
99
|
+
>;
|
|
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
|
+
|
|
71
163
|
export interface DeploymentCreateParams {
|
|
72
164
|
/**
|
|
73
165
|
* Relative path to the entrypoint of the application
|
|
@@ -104,6 +196,7 @@ export interface DeploymentCreateParams {
|
|
|
104
196
|
export declare namespace Deployments {
|
|
105
197
|
export {
|
|
106
198
|
type DeploymentCreateResponse as DeploymentCreateResponse,
|
|
199
|
+
type DeploymentFollowResponse as DeploymentFollowResponse,
|
|
107
200
|
type DeploymentCreateParams as DeploymentCreateParams,
|
|
108
201
|
};
|
|
109
202
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export { Apps } from './apps';
|
|
4
|
-
export {
|
|
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';
|
|
5
10
|
export {
|
|
6
11
|
Invocations,
|
|
7
12
|
type InvocationCreateResponse,
|
package/src/resources/index.ts
CHANGED
package/src/streaming.ts
ADDED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.13'; // 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-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.13";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.13";
|
|
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.1.0-alpha.
|
|
4
|
+
exports.VERSION = '0.1.0-alpha.13'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.13'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|