@onkernel/sdk 0.1.0-alpha.12 → 0.1.0-alpha.14
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 +17 -0
- 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/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/resources/apps/apps.d.mts +2 -2
- package/resources/apps/apps.d.mts.map +1 -1
- package/resources/apps/apps.d.ts +2 -2
- package/resources/apps/apps.d.ts.map +1 -1
- package/resources/apps/apps.js.map +1 -1
- package/resources/apps/apps.mjs +1 -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 +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 +1 -1
- package/resources/apps/index.mjs.map +1 -1
- 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 +7 -1
- package/src/resources/apps/deployments.ts +93 -0
- package/src/resources/apps/index.ts +6 -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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NullableHeaders } from "./headers.js";
|
|
2
2
|
import type { BodyInit } from "./builtin-types.js";
|
|
3
|
+
import { Stream } from "../core/streaming.js";
|
|
3
4
|
import type { HTTPMethod, MergedRequestInit } from "./types.js";
|
|
4
5
|
import { type HeadersLike } from "./headers.js";
|
|
5
6
|
export type FinalRequestOptions = RequestOptions & {
|
|
@@ -19,6 +20,7 @@ export type RequestOptions = {
|
|
|
19
20
|
signal?: AbortSignal | undefined | null;
|
|
20
21
|
idempotencyKey?: string;
|
|
21
22
|
__binaryResponse?: boolean | undefined;
|
|
23
|
+
__streamClass?: typeof Stream;
|
|
22
24
|
};
|
|
23
25
|
export type EncodedContent = {
|
|
24
26
|
bodyHeaders: HeadersLike;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE;OAEnB,KAAK,EAAE,QAAQ,EAAE;OACjB,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE;OACtC,EAAE,KAAK,WAAW,EAAE;AAE3B,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"request-options.d.ts","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"OAEO,EAAE,eAAe,EAAE;OAEnB,KAAK,EAAE,QAAQ,EAAE;OACjB,EAAE,MAAM,EAAE;OACV,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE;OACtC,EAAE,KAAK,WAAW,EAAE;AAE3B,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAAE,WAAW,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,KAAK,cAAc,CAAC;AAEtG,eAAO,MAAM,eAAe,EAAE,cAO7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.js","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;
|
|
1
|
+
{"version":3,"file":"request-options.js","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AA+B/E,MAAM,eAAe,GAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,OAAO;QACL,WAAW,EAAE;YACX,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-options.mjs","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"request-options.mjs","sourceRoot":"","sources":["../src/internal/request-options.ts"],"names":[],"mappings":"AAAA,sFAAsF;AA+BtF,MAAM,CAAC,MAAM,eAAe,GAAmB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,OAAO;QACL,WAAW,EAAE;YACX,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC,CAAC"}
|
package/internal/tslib.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__setModuleDefault = exports.__createBinding = void 0;
|
|
4
|
-
exports.__importStar = __importStar;
|
|
5
4
|
exports.__classPrivateFieldSet = __classPrivateFieldSet;
|
|
6
5
|
exports.__classPrivateFieldGet = __classPrivateFieldGet;
|
|
6
|
+
exports.__importStar = __importStar;
|
|
7
7
|
exports.__exportStar = __exportStar;
|
|
8
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
16
|
+
}
|
|
17
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f)
|
|
19
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
21
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
22
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
23
|
+
}
|
|
8
24
|
var __createBinding = Object.create
|
|
9
25
|
? function (o, m, k, k2) {
|
|
10
26
|
if (k2 === void 0)
|
|
@@ -58,22 +74,6 @@ function __importStar(mod) {
|
|
|
58
74
|
__setModuleDefault(result, mod);
|
|
59
75
|
return result;
|
|
60
76
|
}
|
|
61
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
62
|
-
if (kind === "m")
|
|
63
|
-
throw new TypeError("Private method is not writable");
|
|
64
|
-
if (kind === "a" && !f)
|
|
65
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
66
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
67
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
68
|
-
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
69
|
-
}
|
|
70
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
71
|
-
if (kind === "a" && !f)
|
|
72
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
73
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
74
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
75
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
76
|
-
}
|
|
77
77
|
function __exportStar(m, o) {
|
|
78
78
|
for (var p in m)
|
|
79
79
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onkernel/sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.14",
|
|
4
4
|
"description": "The official TypeScript library for the Kernel API",
|
|
5
5
|
"author": "Kernel <>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -118,6 +118,16 @@
|
|
|
118
118
|
"./resources.mjs": {
|
|
119
119
|
"default": "./resources.mjs"
|
|
120
120
|
},
|
|
121
|
+
"./streaming": {
|
|
122
|
+
"import": "./streaming.mjs",
|
|
123
|
+
"require": "./streaming.js"
|
|
124
|
+
},
|
|
125
|
+
"./streaming.js": {
|
|
126
|
+
"default": "./streaming.js"
|
|
127
|
+
},
|
|
128
|
+
"./streaming.mjs": {
|
|
129
|
+
"default": "./streaming.mjs"
|
|
130
|
+
},
|
|
121
131
|
"./uploads": {
|
|
122
132
|
"import": "./uploads.mjs",
|
|
123
133
|
"require": "./uploads.js"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import * as DeploymentsAPI from "./deployments.mjs";
|
|
3
|
-
import { DeploymentCreateParams, DeploymentCreateResponse, Deployments } from "./deployments.mjs";
|
|
3
|
+
import { DeploymentCreateParams, DeploymentCreateResponse, DeploymentFollowResponse, Deployments } from "./deployments.mjs";
|
|
4
4
|
import * as InvocationsAPI from "./invocations.mjs";
|
|
5
5
|
import { InvocationCreateParams, InvocationCreateResponse, InvocationRetrieveResponse, Invocations } from "./invocations.mjs";
|
|
6
6
|
export declare class Apps extends APIResource {
|
|
@@ -8,7 +8,7 @@ export declare class Apps extends APIResource {
|
|
|
8
8
|
invocations: InvocationsAPI.Invocations;
|
|
9
9
|
}
|
|
10
10
|
export declare namespace Apps {
|
|
11
|
-
export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
11
|
+
export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentFollowResponse as DeploymentFollowResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
12
12
|
export { Invocations as Invocations, type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=apps.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.mts","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,
|
|
1
|
+
{"version":3,"file":"apps.d.mts","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,WAAW,EACZ;OACM,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,WAAW,EACZ;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAKD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
package/resources/apps/apps.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as DeploymentsAPI from "./deployments.js";
|
|
3
|
-
import { DeploymentCreateParams, DeploymentCreateResponse, Deployments } from "./deployments.js";
|
|
3
|
+
import { DeploymentCreateParams, DeploymentCreateResponse, DeploymentFollowResponse, Deployments } from "./deployments.js";
|
|
4
4
|
import * as InvocationsAPI from "./invocations.js";
|
|
5
5
|
import { InvocationCreateParams, InvocationCreateResponse, InvocationRetrieveResponse, Invocations } from "./invocations.js";
|
|
6
6
|
export declare class Apps extends APIResource {
|
|
@@ -8,7 +8,7 @@ export declare class Apps extends APIResource {
|
|
|
8
8
|
invocations: InvocationsAPI.Invocations;
|
|
9
9
|
}
|
|
10
10
|
export declare namespace Apps {
|
|
11
|
-
export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
11
|
+
export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentFollowResponse as DeploymentFollowResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
12
12
|
export { Invocations as Invocations, type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,wBAAwB,EACxB,WAAW,EACZ;OACM,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,WAAW,EACZ;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAKD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,kDAKuB;AACvB,yEAAgD;AAChD,kDAKuB;AAEvB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAHD,oBAGC;AAED,IAAI,CAAC,WAAW,GAAG,yBAAW,CAAC;AAC/B,IAAI,CAAC,WAAW,GAAG,yBAAW,CAAC"}
|
package/resources/apps/apps.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as DeploymentsAPI from "./deployments.mjs";
|
|
4
|
-
import { Deployments } from "./deployments.mjs";
|
|
4
|
+
import { Deployments, } from "./deployments.mjs";
|
|
5
5
|
import * as InvocationsAPI from "./invocations.mjs";
|
|
6
6
|
import { Invocations, } from "./invocations.mjs";
|
|
7
7
|
export class Apps extends APIResource {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.mjs","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,
|
|
1
|
+
{"version":3,"file":"apps.mjs","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAIL,WAAW,GACZ;OACM,KAAK,cAAc;OACnB,EAIL,WAAW,GACZ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAED,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { Stream } from "../../core/streaming.mjs";
|
|
3
4
|
import { type Uploadable } from "../../core/uploads.mjs";
|
|
4
5
|
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
6
|
export declare class Deployments extends APIResource {
|
|
@@ -15,6 +16,17 @@ export declare class Deployments extends APIResource {
|
|
|
15
16
|
* ```
|
|
16
17
|
*/
|
|
17
18
|
create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
|
|
21
|
+
* status updates for a deployed application. The stream terminates automatically
|
|
22
|
+
* once the application reaches a terminal state.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const response = await client.apps.deployments.follow('id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
follow(id: string, options?: RequestOptions): APIPromise<Stream<DeploymentFollowResponse>>;
|
|
18
30
|
}
|
|
19
31
|
export interface DeploymentCreateResponse {
|
|
20
32
|
/**
|
|
@@ -54,6 +66,63 @@ export declare namespace DeploymentCreateResponse {
|
|
|
54
66
|
}
|
|
55
67
|
}
|
|
56
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* A stream of application events (state updates and logs) in SSE format.
|
|
71
|
+
*/
|
|
72
|
+
export type DeploymentFollowResponse = Array<DeploymentFollowResponse.StateEvent | DeploymentFollowResponse.StateUpdateEvent | DeploymentFollowResponse.LogEvent>;
|
|
73
|
+
export declare namespace DeploymentFollowResponse {
|
|
74
|
+
/**
|
|
75
|
+
* Initial state of the application, emitted once when subscribing.
|
|
76
|
+
*/
|
|
77
|
+
interface StateEvent {
|
|
78
|
+
/**
|
|
79
|
+
* Event type identifier (always "state").
|
|
80
|
+
*/
|
|
81
|
+
event: 'state';
|
|
82
|
+
/**
|
|
83
|
+
* Current application state (e.g., "deploying", "running", "succeeded", "failed").
|
|
84
|
+
*/
|
|
85
|
+
state: string;
|
|
86
|
+
/**
|
|
87
|
+
* Time the state was reported.
|
|
88
|
+
*/
|
|
89
|
+
timestamp?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* An update emitted when the application's state changes.
|
|
93
|
+
*/
|
|
94
|
+
interface StateUpdateEvent {
|
|
95
|
+
/**
|
|
96
|
+
* Event type identifier (always "state_update").
|
|
97
|
+
*/
|
|
98
|
+
event: 'state_update';
|
|
99
|
+
/**
|
|
100
|
+
* New application state (e.g., "running", "succeeded", "failed").
|
|
101
|
+
*/
|
|
102
|
+
state: string;
|
|
103
|
+
/**
|
|
104
|
+
* Time the state change occurred.
|
|
105
|
+
*/
|
|
106
|
+
timestamp?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A log entry from the application.
|
|
110
|
+
*/
|
|
111
|
+
interface LogEvent {
|
|
112
|
+
/**
|
|
113
|
+
* Event type identifier (always "log").
|
|
114
|
+
*/
|
|
115
|
+
event: 'log';
|
|
116
|
+
/**
|
|
117
|
+
* Log message text.
|
|
118
|
+
*/
|
|
119
|
+
message: string;
|
|
120
|
+
/**
|
|
121
|
+
* Time the log entry was produced.
|
|
122
|
+
*/
|
|
123
|
+
timestamp?: string;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
57
126
|
export interface DeploymentCreateParams {
|
|
58
127
|
/**
|
|
59
128
|
* Relative path to the entrypoint of the application
|
|
@@ -82,6 +151,6 @@ export interface DeploymentCreateParams {
|
|
|
82
151
|
version?: string;
|
|
83
152
|
}
|
|
84
153
|
export declare namespace Deployments {
|
|
85
|
-
export { type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
154
|
+
export { type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentFollowResponse as DeploymentFollowResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
86
155
|
}
|
|
87
156
|
//# sourceMappingURL=deployments.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.d.mts","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"deployments.d.mts","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OACV,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;CAO3F;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAE1C;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;IAExD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,GAAG;QAClB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAE3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,GAAG,CAAC;QACnB,UAAiB,MAAM;YACrB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,CACxC,wBAAwB,CAAC,UAAU,GACnC,wBAAwB,CAAC,gBAAgB,GACzC,wBAAwB,CAAC,QAAQ,CACpC,CAAC;AAEF,yBAAiB,wBAAwB,CAAC;IACxC;;OAEG;IACH,UAAiB,UAAU;QACzB;;WAEG;QACH,KAAK,EAAE,OAAO,CAAC;QAEf;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED;;OAEG;IACH,UAAiB,gBAAgB;QAC/B;;WAEG;QACH,KAAK,EAAE,cAAc,CAAC;QAEtB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED;;OAEG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,KAAK,EAAE,KAAK,CAAC;QAEb;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { Stream } from "../../core/streaming.js";
|
|
3
4
|
import { type Uploadable } from "../../core/uploads.js";
|
|
4
5
|
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
6
|
export declare class Deployments extends APIResource {
|
|
@@ -15,6 +16,17 @@ export declare class Deployments extends APIResource {
|
|
|
15
16
|
* ```
|
|
16
17
|
*/
|
|
17
18
|
create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
|
|
21
|
+
* status updates for a deployed application. The stream terminates automatically
|
|
22
|
+
* once the application reaches a terminal state.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const response = await client.apps.deployments.follow('id');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
follow(id: string, options?: RequestOptions): APIPromise<Stream<DeploymentFollowResponse>>;
|
|
18
30
|
}
|
|
19
31
|
export interface DeploymentCreateResponse {
|
|
20
32
|
/**
|
|
@@ -54,6 +66,63 @@ export declare namespace DeploymentCreateResponse {
|
|
|
54
66
|
}
|
|
55
67
|
}
|
|
56
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* A stream of application events (state updates and logs) in SSE format.
|
|
71
|
+
*/
|
|
72
|
+
export type DeploymentFollowResponse = Array<DeploymentFollowResponse.StateEvent | DeploymentFollowResponse.StateUpdateEvent | DeploymentFollowResponse.LogEvent>;
|
|
73
|
+
export declare namespace DeploymentFollowResponse {
|
|
74
|
+
/**
|
|
75
|
+
* Initial state of the application, emitted once when subscribing.
|
|
76
|
+
*/
|
|
77
|
+
interface StateEvent {
|
|
78
|
+
/**
|
|
79
|
+
* Event type identifier (always "state").
|
|
80
|
+
*/
|
|
81
|
+
event: 'state';
|
|
82
|
+
/**
|
|
83
|
+
* Current application state (e.g., "deploying", "running", "succeeded", "failed").
|
|
84
|
+
*/
|
|
85
|
+
state: string;
|
|
86
|
+
/**
|
|
87
|
+
* Time the state was reported.
|
|
88
|
+
*/
|
|
89
|
+
timestamp?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* An update emitted when the application's state changes.
|
|
93
|
+
*/
|
|
94
|
+
interface StateUpdateEvent {
|
|
95
|
+
/**
|
|
96
|
+
* Event type identifier (always "state_update").
|
|
97
|
+
*/
|
|
98
|
+
event: 'state_update';
|
|
99
|
+
/**
|
|
100
|
+
* New application state (e.g., "running", "succeeded", "failed").
|
|
101
|
+
*/
|
|
102
|
+
state: string;
|
|
103
|
+
/**
|
|
104
|
+
* Time the state change occurred.
|
|
105
|
+
*/
|
|
106
|
+
timestamp?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A log entry from the application.
|
|
110
|
+
*/
|
|
111
|
+
interface LogEvent {
|
|
112
|
+
/**
|
|
113
|
+
* Event type identifier (always "log").
|
|
114
|
+
*/
|
|
115
|
+
event: 'log';
|
|
116
|
+
/**
|
|
117
|
+
* Log message text.
|
|
118
|
+
*/
|
|
119
|
+
message: string;
|
|
120
|
+
/**
|
|
121
|
+
* Time the log entry was produced.
|
|
122
|
+
*/
|
|
123
|
+
timestamp?: string;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
57
126
|
export interface DeploymentCreateParams {
|
|
58
127
|
/**
|
|
59
128
|
* Relative path to the entrypoint of the application
|
|
@@ -82,6 +151,6 @@ export interface DeploymentCreateParams {
|
|
|
82
151
|
version?: string;
|
|
83
152
|
}
|
|
84
153
|
export declare namespace Deployments {
|
|
85
|
-
export { type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
154
|
+
export { type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentFollowResponse as DeploymentFollowResponse, type DeploymentCreateParams as DeploymentCreateParams, };
|
|
86
155
|
}
|
|
87
156
|
//# sourceMappingURL=deployments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE;OACV,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAIzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;CAO3F;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAE1C;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;IAExD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,GAAG;QAClB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAE3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,GAAG,CAAC;QACnB,UAAiB,MAAM;YACrB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,CACxC,wBAAwB,CAAC,UAAU,GACnC,wBAAwB,CAAC,gBAAgB,GACzC,wBAAwB,CAAC,QAAQ,CACpC,CAAC;AAEF,yBAAiB,wBAAwB,CAAC;IACxC;;OAEG;IACH,UAAiB,UAAU;QACzB;;WAEG;QACH,KAAK,EAAE,OAAO,CAAC;QAEf;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED;;OAEG;IACH,UAAiB,gBAAgB;QAC/B;;WAEG;QACH,KAAK,EAAE,cAAc,CAAC;QAEtB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED;;OAEG;IACH,UAAiB,QAAQ;QACvB;;WAEG;QACH,KAAK,EAAE,KAAK,CAAC;QAEb;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Deployments = void 0;
|
|
5
5
|
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const headers_1 = require("../../internal/headers.js");
|
|
6
7
|
const uploads_1 = require("../../internal/uploads.js");
|
|
8
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
9
|
class Deployments extends resource_1.APIResource {
|
|
8
10
|
/**
|
|
9
11
|
* Deploy a new application
|
|
@@ -19,6 +21,23 @@ class Deployments extends resource_1.APIResource {
|
|
|
19
21
|
create(body, options) {
|
|
20
22
|
return this._client.post('/deploy', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
|
|
26
|
+
* status updates for a deployed application. The stream terminates automatically
|
|
27
|
+
* once the application reaches a terminal state.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const response = await client.apps.deployments.follow('id');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
follow(id, options) {
|
|
35
|
+
return this._client.get((0, path_1.path) `/apps/${id}/events`, {
|
|
36
|
+
...options,
|
|
37
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
38
|
+
stream: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
22
41
|
}
|
|
23
42
|
exports.Deployments = Deployments;
|
|
24
43
|
//# sourceMappingURL=deployments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAqE;
|
|
1
|
+
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAsD;AAEtD,uDAAqE;AACrE,uDAAiD;AAEjD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,SAAS,EAAE,SAAS,EAAE;YAChD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAiD,CAAC;IACrD,CAAC;CACF;AAjCD,kCAiCC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
3
4
|
import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
|
|
5
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
6
|
export class Deployments extends APIResource {
|
|
5
7
|
/**
|
|
6
8
|
* Deploy a new application
|
|
@@ -16,5 +18,22 @@ export class Deployments extends APIResource {
|
|
|
16
18
|
create(body, options) {
|
|
17
19
|
return this._client.post('/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
18
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Establishes a Server-Sent Events (SSE) stream that delivers real-time logs and
|
|
23
|
+
* status updates for a deployed application. The stream terminates automatically
|
|
24
|
+
* once the application reaches a terminal state.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const response = await client.apps.deployments.follow('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
follow(id, options) {
|
|
32
|
+
return this._client.get(path `/apps/${id}/events`, {
|
|
33
|
+
...options,
|
|
34
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
35
|
+
stream: true,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
19
38
|
}
|
|
20
39
|
//# sourceMappingURL=deployments.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.mjs","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,2BAA2B,EAAE;
|
|
1
|
+
{"version":3,"file":"deployments.mjs","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACvG,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,SAAS,EAAE,SAAS,EAAE;YAChD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAAiD,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Apps } from "./apps.mjs";
|
|
2
|
-
export { Deployments, type DeploymentCreateResponse, type DeploymentCreateParams } from "./deployments.mjs";
|
|
2
|
+
export { Deployments, type DeploymentCreateResponse, type DeploymentFollowResponse, type DeploymentCreateParams, } from "./deployments.mjs";
|
|
3
3
|
export { Invocations, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationCreateParams, } from "./invocations.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,GAC5B;OACM,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Apps } from "./apps.js";
|
|
2
|
-
export { Deployments, type DeploymentCreateResponse, type DeploymentCreateParams } from "./deployments.js";
|
|
2
|
+
export { Deployments, type DeploymentCreateResponse, type DeploymentFollowResponse, type DeploymentCreateParams, } from "./deployments.js";
|
|
3
3
|
export { Invocations, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationCreateParams, } from "./invocations.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,GAC5B;OACM,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,gDAKuB;AAJrB,0GAAA,WAAW,OAAA;AAKb,gDAKuB;AAJrB,0GAAA,WAAW,OAAA"}
|
package/resources/apps/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Apps } from "./apps.mjs";
|
|
3
|
-
export { Deployments } from "./deployments.mjs";
|
|
3
|
+
export { Deployments, } from "./deployments.mjs";
|
|
4
4
|
export { Invocations, } from "./invocations.mjs";
|
|
5
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,WAAW,GAIZ;OACM,EACL,WAAW,GAIZ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface KernelContext {
|
|
2
|
-
|
|
2
|
+
invocation_id: string;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
export interface KernelAction {
|
|
6
6
|
name: string;
|
|
7
|
-
handler: (context: KernelContext,
|
|
7
|
+
handler: (context: KernelContext, payload?: any) => Promise<any>;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface KernelJson {
|
|
@@ -34,45 +34,28 @@ export class KernelApp {
|
|
|
34
34
|
* Define an action
|
|
35
35
|
*/
|
|
36
36
|
action<T, R>(
|
|
37
|
-
|
|
38
|
-
handler
|
|
37
|
+
name: string,
|
|
38
|
+
handler: ((context: KernelContext) => Promise<R>) | ((context: KernelContext, payload?: T) => Promise<R>),
|
|
39
39
|
) {
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const singleArgHandler = handler as (input: T) => Promise<R>;
|
|
51
|
-
actionHandler = async (context: KernelContext, input: T) => singleArgHandler(input);
|
|
52
|
-
} else {
|
|
53
|
-
// Handler takes both context and input
|
|
54
|
-
actionHandler = handler as (context: KernelContext, input: T) => Promise<R>;
|
|
55
|
-
}
|
|
56
|
-
} else if (typeof nameOrHandler === 'function') {
|
|
57
|
-
// Case: app.action(handler)
|
|
58
|
-
actionName = nameOrHandler.name || 'default';
|
|
59
|
-
|
|
60
|
-
// Create a handler that accepts context and input, adapting if needed
|
|
61
|
-
if (nameOrHandler.length === 1) {
|
|
62
|
-
// Original handler only takes input, so we adapt it to the new signature
|
|
63
|
-
const singleArgHandler = nameOrHandler as (input: T) => Promise<R>;
|
|
64
|
-
actionHandler = async (context: KernelContext, input: T) => singleArgHandler(input);
|
|
65
|
-
} else {
|
|
66
|
-
// Handler takes both context and input
|
|
67
|
-
actionHandler = nameOrHandler as (context: KernelContext, input: T) => Promise<R>;
|
|
68
|
-
}
|
|
40
|
+
let actionHandler: (context: KernelContext, payload?: T) => Promise<R>;
|
|
41
|
+
|
|
42
|
+
// Create a handler that accepts context and payload, adapting if needed
|
|
43
|
+
if (handler.length === 0) {
|
|
44
|
+
// Handlers with no arguments are not supported
|
|
45
|
+
throw new Error('Action handlers must accept at least the context parameter');
|
|
46
|
+
} else if (handler.length === 1) {
|
|
47
|
+
// Handler takes context only
|
|
48
|
+
const contextOnlyHandler = handler as (context: KernelContext) => Promise<R>;
|
|
49
|
+
actionHandler = async (context: KernelContext, _payload?: T) => contextOnlyHandler(context);
|
|
69
50
|
} else {
|
|
70
|
-
|
|
51
|
+
// Handler takes both context and payload
|
|
52
|
+
const twoArgHandler = handler as (context: KernelContext, payload?: T) => Promise<R>;
|
|
53
|
+
actionHandler = twoArgHandler;
|
|
71
54
|
}
|
|
72
55
|
|
|
73
56
|
// Register the action
|
|
74
|
-
this.actions.set(
|
|
75
|
-
name
|
|
57
|
+
this.actions.set(name, {
|
|
58
|
+
name,
|
|
76
59
|
handler: actionHandler,
|
|
77
60
|
});
|
|
78
61
|
|