@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,39 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../../internal/headers.mjs";
|
|
4
|
+
import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
|
|
5
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
6
|
+
export class Deployments extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Deploy a new application
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const deployment = await client.apps.deployments.create({
|
|
13
|
+
* entrypoint_rel_path: 'src/app.py',
|
|
14
|
+
* file: fs.createReadStream('path/to/file'),
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
create(body, options) {
|
|
19
|
+
return this._client.post('/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
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
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=deployments.mjs.map
|
|
@@ -0,0 +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,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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Apps, type AppListResponse, type AppListParams } from "./apps.mjs";
|
|
2
|
+
export { Deployments, type DeploymentCreateResponse, type DeploymentFollowResponse, type DeploymentCreateParams, } from "./deployments.mjs";
|
|
3
|
+
export { Invocations, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationCreateParams, } from "./invocations.mjs";
|
|
4
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE;OAClD,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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Apps, type AppListResponse, type AppListParams } from "./apps.js";
|
|
2
|
+
export { Deployments, type DeploymentCreateResponse, type DeploymentFollowResponse, type DeploymentCreateParams, } from "./deployments.js";
|
|
3
|
+
export { Invocations, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationCreateParams, } from "./invocations.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE;OAClD,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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Invocations = exports.Deployments = exports.Apps = void 0;
|
|
5
|
+
var apps_1 = require("./apps.js");
|
|
6
|
+
Object.defineProperty(exports, "Apps", { enumerable: true, get: function () { return apps_1.Apps; } });
|
|
7
|
+
var deployments_1 = require("./deployments.js");
|
|
8
|
+
Object.defineProperty(exports, "Deployments", { enumerable: true, get: function () { return deployments_1.Deployments; } });
|
|
9
|
+
var invocations_1 = require("./invocations.js");
|
|
10
|
+
Object.defineProperty(exports, "Invocations", { enumerable: true, get: function () { return invocations_1.Invocations; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAAwE;AAA/D,4FAAA,IAAI,OAAA;AACb,gDAKuB;AAJrB,0GAAA,WAAW,OAAA;AAKb,gDAKuB;AAJrB,0GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAA4C;OAClD,EACL,WAAW,GAIZ;OACM,EACL,WAAW,GAIZ"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
4
|
+
export declare class Invocations extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Invoke an application
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const invocation = await client.apps.invocations.create({
|
|
11
|
+
* action_name: 'analyze',
|
|
12
|
+
* app_name: 'my-app',
|
|
13
|
+
* version: '1.0.0',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<InvocationCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Get an app invocation by id
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const invocation = await client.apps.invocations.retrieve(
|
|
24
|
+
* 'ckqwer3o20000jb9s7abcdef',
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse>;
|
|
29
|
+
}
|
|
30
|
+
export interface InvocationCreateResponse {
|
|
31
|
+
/**
|
|
32
|
+
* ID of the invocation
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* Status of the invocation
|
|
37
|
+
*/
|
|
38
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
39
|
+
/**
|
|
40
|
+
* The return value of the action that was invoked, rendered as a JSON string. This
|
|
41
|
+
* could be: string, number, boolean, array, object, or null.
|
|
42
|
+
*/
|
|
43
|
+
output?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Status reason
|
|
46
|
+
*/
|
|
47
|
+
status_reason?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface InvocationRetrieveResponse {
|
|
50
|
+
/**
|
|
51
|
+
* ID of the invocation
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Name of the action invoked
|
|
56
|
+
*/
|
|
57
|
+
action_name: string;
|
|
58
|
+
/**
|
|
59
|
+
* Name of the application
|
|
60
|
+
*/
|
|
61
|
+
app_name: string;
|
|
62
|
+
/**
|
|
63
|
+
* RFC 3339 Nanoseconds timestamp when the invocation started
|
|
64
|
+
*/
|
|
65
|
+
started_at: string;
|
|
66
|
+
/**
|
|
67
|
+
* Status of the invocation
|
|
68
|
+
*/
|
|
69
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
70
|
+
/**
|
|
71
|
+
* RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
|
|
72
|
+
* running)
|
|
73
|
+
*/
|
|
74
|
+
finished_at?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Output produced by the action, rendered as a JSON string. This could be: string,
|
|
77
|
+
* number, boolean, array, object, or null.
|
|
78
|
+
*/
|
|
79
|
+
output?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Payload provided to the invocation. This is a string that can be parsed as JSON.
|
|
82
|
+
*/
|
|
83
|
+
payload?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Status reason
|
|
86
|
+
*/
|
|
87
|
+
status_reason?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface InvocationCreateParams {
|
|
90
|
+
/**
|
|
91
|
+
* Name of the action to invoke
|
|
92
|
+
*/
|
|
93
|
+
action_name: string;
|
|
94
|
+
/**
|
|
95
|
+
* Name of the application
|
|
96
|
+
*/
|
|
97
|
+
app_name: string;
|
|
98
|
+
/**
|
|
99
|
+
* Version of the application
|
|
100
|
+
*/
|
|
101
|
+
version: string;
|
|
102
|
+
/**
|
|
103
|
+
* Input data for the action, sent as a JSON string.
|
|
104
|
+
*/
|
|
105
|
+
payload?: string;
|
|
106
|
+
}
|
|
107
|
+
export declare namespace Invocations {
|
|
108
|
+
export { type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=invocations.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocations.d.mts","sourceRoot":"","sources":["../../src/resources/apps/invocations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGvF;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEtD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEtD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
export declare class Invocations extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Invoke an application
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const invocation = await client.apps.invocations.create({
|
|
11
|
+
* action_name: 'analyze',
|
|
12
|
+
* app_name: 'my-app',
|
|
13
|
+
* version: '1.0.0',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<InvocationCreateResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Get an app invocation by id
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const invocation = await client.apps.invocations.retrieve(
|
|
24
|
+
* 'ckqwer3o20000jb9s7abcdef',
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse>;
|
|
29
|
+
}
|
|
30
|
+
export interface InvocationCreateResponse {
|
|
31
|
+
/**
|
|
32
|
+
* ID of the invocation
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* Status of the invocation
|
|
37
|
+
*/
|
|
38
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
39
|
+
/**
|
|
40
|
+
* The return value of the action that was invoked, rendered as a JSON string. This
|
|
41
|
+
* could be: string, number, boolean, array, object, or null.
|
|
42
|
+
*/
|
|
43
|
+
output?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Status reason
|
|
46
|
+
*/
|
|
47
|
+
status_reason?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface InvocationRetrieveResponse {
|
|
50
|
+
/**
|
|
51
|
+
* ID of the invocation
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Name of the action invoked
|
|
56
|
+
*/
|
|
57
|
+
action_name: string;
|
|
58
|
+
/**
|
|
59
|
+
* Name of the application
|
|
60
|
+
*/
|
|
61
|
+
app_name: string;
|
|
62
|
+
/**
|
|
63
|
+
* RFC 3339 Nanoseconds timestamp when the invocation started
|
|
64
|
+
*/
|
|
65
|
+
started_at: string;
|
|
66
|
+
/**
|
|
67
|
+
* Status of the invocation
|
|
68
|
+
*/
|
|
69
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
70
|
+
/**
|
|
71
|
+
* RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
|
|
72
|
+
* running)
|
|
73
|
+
*/
|
|
74
|
+
finished_at?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Output produced by the action, rendered as a JSON string. This could be: string,
|
|
77
|
+
* number, boolean, array, object, or null.
|
|
78
|
+
*/
|
|
79
|
+
output?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Payload provided to the invocation. This is a string that can be parsed as JSON.
|
|
82
|
+
*/
|
|
83
|
+
payload?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Status reason
|
|
86
|
+
*/
|
|
87
|
+
status_reason?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface InvocationCreateParams {
|
|
90
|
+
/**
|
|
91
|
+
* Name of the action to invoke
|
|
92
|
+
*/
|
|
93
|
+
action_name: string;
|
|
94
|
+
/**
|
|
95
|
+
* Name of the application
|
|
96
|
+
*/
|
|
97
|
+
app_name: string;
|
|
98
|
+
/**
|
|
99
|
+
* Version of the application
|
|
100
|
+
*/
|
|
101
|
+
version: string;
|
|
102
|
+
/**
|
|
103
|
+
* Input data for the action, sent as a JSON string.
|
|
104
|
+
*/
|
|
105
|
+
payload?: string;
|
|
106
|
+
}
|
|
107
|
+
export declare namespace Invocations {
|
|
108
|
+
export { type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=invocations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocations.d.ts","sourceRoot":"","sources":["../../src/resources/apps/invocations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGvF;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEtD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEtD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Invocations = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../internal/utils/path.js");
|
|
7
|
+
class Invocations extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Invoke an application
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const invocation = await client.apps.invocations.create({
|
|
14
|
+
* action_name: 'analyze',
|
|
15
|
+
* app_name: 'my-app',
|
|
16
|
+
* version: '1.0.0',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body, options) {
|
|
21
|
+
return this._client.post('/invocations', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get an app invocation by id
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const invocation = await client.apps.invocations.retrieve(
|
|
29
|
+
* 'ckqwer3o20000jb9s7abcdef',
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
retrieve(id, options) {
|
|
34
|
+
return this._client.get((0, path_1.path) `/invocations/${id}`, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.Invocations = Invocations;
|
|
38
|
+
//# sourceMappingURL=invocations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocations.js","sourceRoot":"","sources":["../../src/resources/apps/invocations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF;AA9BD,kCA8BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
4
|
+
export class Invocations extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Invoke an application
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const invocation = await client.apps.invocations.create({
|
|
11
|
+
* action_name: 'analyze',
|
|
12
|
+
* app_name: 'my-app',
|
|
13
|
+
* version: '1.0.0',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
create(body, options) {
|
|
18
|
+
return this._client.post('/invocations', { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get an app invocation by id
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const invocation = await client.apps.invocations.retrieve(
|
|
26
|
+
* 'ckqwer3o20000jb9s7abcdef',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
retrieve(id, options) {
|
|
31
|
+
return this._client.get(path `/invocations/${id}`, options);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=invocations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invocations.mjs","sourceRoot":"","sources":["../../src/resources/apps/invocations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
package/resources/apps.d.mts
CHANGED
|
@@ -1,141 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
-
import { type Uploadable } from "../core/uploads.mjs";
|
|
4
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
-
export declare class Apps extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* Deploy a new application
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* const response = await client.apps.deploy({
|
|
12
|
-
* file: fs.createReadStream('path/to/file'),
|
|
13
|
-
* });
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
deploy(body: AppDeployParams, options?: RequestOptions): APIPromise<AppDeployResponse>;
|
|
17
|
-
/**
|
|
18
|
-
* Invoke an application
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```ts
|
|
22
|
-
* const response = await client.apps.invoke({
|
|
23
|
-
* actionName: 'analyze',
|
|
24
|
-
* appName: 'my-awesome-app',
|
|
25
|
-
* payload: { data: 'example input' },
|
|
26
|
-
* version: '1.0.0',
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
invoke(body: AppInvokeParams, options?: RequestOptions): APIPromise<AppInvokeResponse>;
|
|
31
|
-
/**
|
|
32
|
-
* Get an app invocation by id
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const response = await client.apps.retrieveInvocation(
|
|
37
|
-
* 'ckqwer3o20000jb9s7abcdef',
|
|
38
|
-
* );
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
retrieveInvocation(id: string, options?: RequestOptions): APIPromise<AppRetrieveInvocationResponse>;
|
|
42
|
-
}
|
|
43
|
-
export interface AppDeployResponse {
|
|
44
|
-
apps: Array<AppDeployResponse.App>;
|
|
45
|
-
/**
|
|
46
|
-
* Success message
|
|
47
|
-
*/
|
|
48
|
-
message: string;
|
|
49
|
-
/**
|
|
50
|
-
* Status of the deployment
|
|
51
|
-
*/
|
|
52
|
-
success: boolean;
|
|
53
|
-
}
|
|
54
|
-
export declare namespace AppDeployResponse {
|
|
55
|
-
interface App {
|
|
56
|
-
/**
|
|
57
|
-
* ID for the app version deployed
|
|
58
|
-
*/
|
|
59
|
-
id: string;
|
|
60
|
-
actions: Array<App.Action>;
|
|
61
|
-
/**
|
|
62
|
-
* Name of the app
|
|
63
|
-
*/
|
|
64
|
-
name: string;
|
|
65
|
-
}
|
|
66
|
-
namespace App {
|
|
67
|
-
interface Action {
|
|
68
|
-
/**
|
|
69
|
-
* Name of the action
|
|
70
|
-
*/
|
|
71
|
-
name: string;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
export interface AppInvokeResponse {
|
|
76
|
-
/**
|
|
77
|
-
* ID of the invocation
|
|
78
|
-
*/
|
|
79
|
-
id: string;
|
|
80
|
-
/**
|
|
81
|
-
* Status of the invocation
|
|
82
|
-
*/
|
|
83
|
-
status: 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED';
|
|
84
|
-
/**
|
|
85
|
-
* Output from the invocation (if available)
|
|
86
|
-
*/
|
|
87
|
-
output?: string;
|
|
88
|
-
}
|
|
89
|
-
export interface AppRetrieveInvocationResponse {
|
|
90
|
-
id: string;
|
|
91
|
-
appName: string;
|
|
92
|
-
finishedAt: string | null;
|
|
93
|
-
input: string;
|
|
94
|
-
output: string;
|
|
95
|
-
startedAt: string;
|
|
96
|
-
status: string;
|
|
97
|
-
}
|
|
98
|
-
export interface AppDeployParams {
|
|
99
|
-
/**
|
|
100
|
-
* ZIP file containing the application source directory
|
|
101
|
-
*/
|
|
102
|
-
file: Uploadable;
|
|
103
|
-
/**
|
|
104
|
-
* Relative path to the entrypoint of the application
|
|
105
|
-
*/
|
|
106
|
-
entrypointRelPath?: string;
|
|
107
|
-
/**
|
|
108
|
-
* Allow overwriting an existing app version
|
|
109
|
-
*/
|
|
110
|
-
force?: 'true' | 'false';
|
|
111
|
-
/**
|
|
112
|
-
* Region for deployment. Currently we only support "aws.us-east-1a"
|
|
113
|
-
*/
|
|
114
|
-
region?: 'aws.us-east-1a';
|
|
115
|
-
/**
|
|
116
|
-
* Version of the application. Can be any string.
|
|
117
|
-
*/
|
|
118
|
-
version?: string;
|
|
119
|
-
}
|
|
120
|
-
export interface AppInvokeParams {
|
|
121
|
-
/**
|
|
122
|
-
* Name of the action to invoke
|
|
123
|
-
*/
|
|
124
|
-
actionName: string;
|
|
125
|
-
/**
|
|
126
|
-
* Name of the application
|
|
127
|
-
*/
|
|
128
|
-
appName: string;
|
|
129
|
-
/**
|
|
130
|
-
* Input data for the application
|
|
131
|
-
*/
|
|
132
|
-
payload: unknown;
|
|
133
|
-
/**
|
|
134
|
-
* Version of the application
|
|
135
|
-
*/
|
|
136
|
-
version: string;
|
|
137
|
-
}
|
|
138
|
-
export declare namespace Apps {
|
|
139
|
-
export { type AppDeployResponse as AppDeployResponse, type AppInvokeResponse as AppInvokeResponse, type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse, type AppDeployParams as AppDeployParams, type AppInvokeParams as AppInvokeParams, };
|
|
140
|
-
}
|
|
1
|
+
export * from "./apps/index.mjs";
|
|
141
2
|
//# sourceMappingURL=apps.d.mts.map
|
package/resources/apps.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.mts","sourceRoot":"","sources":["../src/resources/apps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apps.d.mts","sourceRoot":"","sources":["../src/resources/apps.ts"],"names":[],"mappings":""}
|