@onkernel/sdk 0.1.0-alpha.10 → 0.1.0-alpha.12
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/README.md +38 -36
- 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/internal/tslib.js +17 -17
- package/package.json +1 -1
- package/resources/apps/apps.d.mts +14 -0
- package/resources/apps/apps.d.mts.map +1 -0
- package/resources/apps/apps.d.ts +14 -0
- package/resources/apps/apps.d.ts.map +1 -0
- package/resources/apps/apps.js +21 -0
- package/resources/apps/apps.js.map +1 -0
- package/resources/apps/apps.mjs +16 -0
- package/resources/apps/apps.mjs.map +1 -0
- package/resources/apps/deployments.d.mts +87 -0
- package/resources/apps/deployments.d.mts.map +1 -0
- package/resources/apps/deployments.d.ts +87 -0
- package/resources/apps/deployments.d.ts.map +1 -0
- package/resources/apps/deployments.js +24 -0
- package/resources/apps/deployments.js.map +1 -0
- package/resources/apps/deployments.mjs +20 -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 -141
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +1 -141
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js +2 -50
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs +1 -48
- 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/resources/apps/apps.ts +35 -0
- package/src/resources/apps/deployments.ts +109 -0
- package/src/resources/apps/index.ts +10 -0
- package/src/resources/apps/invocations.ts +140 -0
- package/src/resources/apps.ts +1 -185
- package/src/resources/browsers.ts +85 -0
- package/src/resources/index.ts +6 -8
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +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
package/resources/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
var apps_1 = require("./apps.js");
|
|
4
|
+
exports.Browsers = exports.Apps = void 0;
|
|
5
|
+
var apps_1 = require("./apps/apps.js");
|
|
6
6
|
Object.defineProperty(exports, "Apps", { enumerable: true, get: function () { return apps_1.Apps; } });
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(exports, "
|
|
7
|
+
var browsers_1 = require("./browsers.js");
|
|
8
|
+
Object.defineProperty(exports, "Browsers", { enumerable: true, get: function () { return browsers_1.Browsers; } });
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,uCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,0CAKoB;AAJlB,oGAAA,QAAQ,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
export { Apps
|
|
3
|
-
export {
|
|
2
|
+
export { Apps } from "./apps/apps.mjs";
|
|
3
|
+
export { Browsers, } from "./browsers.mjs";
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,QAAQ,GAIT"}
|
package/src/client.ts
CHANGED
|
@@ -21,18 +21,16 @@ import { type Fetch } from './internal/builtin-types';
|
|
|
21
21
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
22
22
|
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
23
23
|
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Apps,
|
|
30
|
-
} from './resources/apps';
|
|
31
|
-
import { Browser, BrowserCreateSessionParams, BrowserCreateSessionResponse } from './resources/browser';
|
|
24
|
+
BrowserCreateParams,
|
|
25
|
+
BrowserCreateResponse,
|
|
26
|
+
BrowserRetrieveResponse,
|
|
27
|
+
Browsers,
|
|
28
|
+
} from './resources/browsers';
|
|
32
29
|
import { readEnv } from './internal/utils/env';
|
|
33
30
|
import { formatRequestDetails, loggerFor } from './internal/utils/log';
|
|
34
31
|
import { isEmptyObj } from './internal/utils/values';
|
|
35
32
|
import { KernelApp } from './core/app-framework';
|
|
33
|
+
import { Apps } from './resources/apps/apps';
|
|
36
34
|
|
|
37
35
|
const environments = {
|
|
38
36
|
production: 'https://api.onkernel.com/',
|
|
@@ -735,25 +733,19 @@ export class Kernel {
|
|
|
735
733
|
static toFile = Uploads.toFile;
|
|
736
734
|
|
|
737
735
|
apps: API.Apps = new API.Apps(this);
|
|
738
|
-
|
|
736
|
+
browsers: API.Browsers = new API.Browsers(this);
|
|
739
737
|
}
|
|
740
738
|
Kernel.Apps = Apps;
|
|
741
|
-
Kernel.
|
|
739
|
+
Kernel.Browsers = Browsers;
|
|
742
740
|
export declare namespace Kernel {
|
|
743
741
|
export type RequestOptions = Opts.RequestOptions;
|
|
744
742
|
|
|
745
|
-
export {
|
|
746
|
-
Apps as Apps,
|
|
747
|
-
type AppDeployResponse as AppDeployResponse,
|
|
748
|
-
type AppInvokeResponse as AppInvokeResponse,
|
|
749
|
-
type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse,
|
|
750
|
-
type AppDeployParams as AppDeployParams,
|
|
751
|
-
type AppInvokeParams as AppInvokeParams,
|
|
752
|
-
};
|
|
743
|
+
export { Apps as Apps };
|
|
753
744
|
|
|
754
745
|
export {
|
|
755
|
-
|
|
756
|
-
type
|
|
757
|
-
type
|
|
746
|
+
Browsers as Browsers,
|
|
747
|
+
type BrowserCreateResponse as BrowserCreateResponse,
|
|
748
|
+
type BrowserRetrieveResponse as BrowserRetrieveResponse,
|
|
749
|
+
type BrowserCreateParams as BrowserCreateParams,
|
|
758
750
|
};
|
|
759
751
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as DeploymentsAPI from './deployments';
|
|
5
|
+
import { DeploymentCreateParams, DeploymentCreateResponse, Deployments } from './deployments';
|
|
6
|
+
import * as InvocationsAPI from './invocations';
|
|
7
|
+
import {
|
|
8
|
+
InvocationCreateParams,
|
|
9
|
+
InvocationCreateResponse,
|
|
10
|
+
InvocationRetrieveResponse,
|
|
11
|
+
Invocations,
|
|
12
|
+
} from './invocations';
|
|
13
|
+
|
|
14
|
+
export class Apps extends APIResource {
|
|
15
|
+
deployments: DeploymentsAPI.Deployments = new DeploymentsAPI.Deployments(this._client);
|
|
16
|
+
invocations: InvocationsAPI.Invocations = new InvocationsAPI.Invocations(this._client);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Apps.Deployments = Deployments;
|
|
20
|
+
Apps.Invocations = Invocations;
|
|
21
|
+
|
|
22
|
+
export declare namespace Apps {
|
|
23
|
+
export {
|
|
24
|
+
Deployments as Deployments,
|
|
25
|
+
type DeploymentCreateResponse as DeploymentCreateResponse,
|
|
26
|
+
type DeploymentCreateParams as DeploymentCreateParams,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
Invocations as Invocations,
|
|
31
|
+
type InvocationCreateResponse as InvocationCreateResponse,
|
|
32
|
+
type InvocationRetrieveResponse as InvocationRetrieveResponse,
|
|
33
|
+
type InvocationCreateParams as InvocationCreateParams,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { type Uploadable } from '../../core/uploads';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
8
|
+
|
|
9
|
+
export class Deployments extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Deploy a new application
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const deployment = await client.apps.deployments.create({
|
|
16
|
+
* entrypoint_rel_path: 'src/app.py',
|
|
17
|
+
* file: fs.createReadStream('path/to/file'),
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse> {
|
|
22
|
+
return this._client.post('/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface DeploymentCreateResponse {
|
|
27
|
+
/**
|
|
28
|
+
* List of apps deployed
|
|
29
|
+
*/
|
|
30
|
+
apps: Array<DeploymentCreateResponse.App>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Current status of the deployment
|
|
34
|
+
*/
|
|
35
|
+
status: 'queued' | 'deploying' | 'succeeded' | 'failed';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Status reason
|
|
39
|
+
*/
|
|
40
|
+
status_reason?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export namespace DeploymentCreateResponse {
|
|
44
|
+
export interface App {
|
|
45
|
+
/**
|
|
46
|
+
* ID for the app version deployed
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* List of actions available on the app
|
|
52
|
+
*/
|
|
53
|
+
actions: Array<App.Action>;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Name of the app
|
|
57
|
+
*/
|
|
58
|
+
name: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export namespace App {
|
|
62
|
+
export interface Action {
|
|
63
|
+
/**
|
|
64
|
+
* Name of the action
|
|
65
|
+
*/
|
|
66
|
+
name: string;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface DeploymentCreateParams {
|
|
72
|
+
/**
|
|
73
|
+
* Relative path to the entrypoint of the application
|
|
74
|
+
*/
|
|
75
|
+
entrypoint_rel_path: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* ZIP file containing the application source directory
|
|
79
|
+
*/
|
|
80
|
+
file: Uploadable;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Map of environment variables to set for the deployed application. Each key-value
|
|
84
|
+
* pair represents an environment variable.
|
|
85
|
+
*/
|
|
86
|
+
env_vars?: Record<string, string>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Allow overwriting an existing app version
|
|
90
|
+
*/
|
|
91
|
+
force?: boolean;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Region for deployment. Currently we only support "aws.us-east-1a"
|
|
95
|
+
*/
|
|
96
|
+
region?: 'aws.us-east-1a';
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Version of the application. Can be any string.
|
|
100
|
+
*/
|
|
101
|
+
version?: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare namespace Deployments {
|
|
105
|
+
export {
|
|
106
|
+
type DeploymentCreateResponse as DeploymentCreateResponse,
|
|
107
|
+
type DeploymentCreateParams as DeploymentCreateParams,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Apps } from './apps';
|
|
4
|
+
export { Deployments, type DeploymentCreateResponse, type DeploymentCreateParams } from './deployments';
|
|
5
|
+
export {
|
|
6
|
+
Invocations,
|
|
7
|
+
type InvocationCreateResponse,
|
|
8
|
+
type InvocationRetrieveResponse,
|
|
9
|
+
type InvocationCreateParams,
|
|
10
|
+
} from './invocations';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Invocations extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Invoke an application
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const invocation = await client.apps.invocations.create({
|
|
15
|
+
* action_name: 'analyze',
|
|
16
|
+
* app_name: 'my-app',
|
|
17
|
+
* version: '1.0.0',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<InvocationCreateResponse> {
|
|
22
|
+
return this._client.post('/invocations', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get an app invocation by id
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const invocation = await client.apps.invocations.retrieve(
|
|
31
|
+
* 'ckqwer3o20000jb9s7abcdef',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse> {
|
|
36
|
+
return this._client.get(path`/invocations/${id}`, options);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface InvocationCreateResponse {
|
|
41
|
+
/**
|
|
42
|
+
* ID of the invocation
|
|
43
|
+
*/
|
|
44
|
+
id: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Status of the invocation
|
|
48
|
+
*/
|
|
49
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The return value of the action that was invoked, rendered as a JSON string. This
|
|
53
|
+
* could be: string, number, boolean, array, object, or null.
|
|
54
|
+
*/
|
|
55
|
+
output?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Status reason
|
|
59
|
+
*/
|
|
60
|
+
status_reason?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface InvocationRetrieveResponse {
|
|
64
|
+
/**
|
|
65
|
+
* ID of the invocation
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Name of the action invoked
|
|
71
|
+
*/
|
|
72
|
+
action_name: string;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Name of the application
|
|
76
|
+
*/
|
|
77
|
+
app_name: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* RFC 3339 Nanoseconds timestamp when the invocation started
|
|
81
|
+
*/
|
|
82
|
+
started_at: string;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Status of the invocation
|
|
86
|
+
*/
|
|
87
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
|
|
91
|
+
* running)
|
|
92
|
+
*/
|
|
93
|
+
finished_at?: string | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Output produced by the action, rendered as a JSON string. This could be: string,
|
|
97
|
+
* number, boolean, array, object, or null.
|
|
98
|
+
*/
|
|
99
|
+
output?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Payload provided to the invocation. This is a string that can be parsed as JSON.
|
|
103
|
+
*/
|
|
104
|
+
payload?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Status reason
|
|
108
|
+
*/
|
|
109
|
+
status_reason?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface InvocationCreateParams {
|
|
113
|
+
/**
|
|
114
|
+
* Name of the action to invoke
|
|
115
|
+
*/
|
|
116
|
+
action_name: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Name of the application
|
|
120
|
+
*/
|
|
121
|
+
app_name: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Version of the application
|
|
125
|
+
*/
|
|
126
|
+
version: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Input data for the action, sent as a JSON string.
|
|
130
|
+
*/
|
|
131
|
+
payload?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare namespace Invocations {
|
|
135
|
+
export {
|
|
136
|
+
type InvocationCreateResponse as InvocationCreateResponse,
|
|
137
|
+
type InvocationRetrieveResponse as InvocationRetrieveResponse,
|
|
138
|
+
type InvocationCreateParams as InvocationCreateParams,
|
|
139
|
+
};
|
|
140
|
+
}
|
package/src/resources/apps.ts
CHANGED
|
@@ -1,187 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import { APIPromise } from '../core/api-promise';
|
|
5
|
-
import { type Uploadable } from '../core/uploads';
|
|
6
|
-
import { RequestOptions } from '../internal/request-options';
|
|
7
|
-
import { multipartFormRequestOptions } from '../internal/uploads';
|
|
8
|
-
import { path } from '../internal/utils/path';
|
|
9
|
-
|
|
10
|
-
export class Apps extends APIResource {
|
|
11
|
-
/**
|
|
12
|
-
* Deploy a new application
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const response = await client.apps.deploy({
|
|
17
|
-
* entrypointRelPath: 'app.py',
|
|
18
|
-
* file: fs.createReadStream('path/to/file'),
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
deploy(body: AppDeployParams, options?: RequestOptions): APIPromise<AppDeployResponse> {
|
|
23
|
-
return this._client.post('/apps/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Invoke an application
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```ts
|
|
31
|
-
* const response = await client.apps.invoke({
|
|
32
|
-
* actionName: 'analyze',
|
|
33
|
-
* appName: 'my-awesome-app',
|
|
34
|
-
* payload: { data: 'example input' },
|
|
35
|
-
* version: '1.0.0',
|
|
36
|
-
* });
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
invoke(body: AppInvokeParams, options?: RequestOptions): APIPromise<AppInvokeResponse> {
|
|
40
|
-
return this._client.post('/apps/invoke', { body, ...options });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get an app invocation by id
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```ts
|
|
48
|
-
* const response = await client.apps.retrieveInvocation(
|
|
49
|
-
* 'ckqwer3o20000jb9s7abcdef',
|
|
50
|
-
* );
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
retrieveInvocation(id: string, options?: RequestOptions): APIPromise<AppRetrieveInvocationResponse> {
|
|
54
|
-
return this._client.get(path`/apps/invocations/${id}`, options);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface AppDeployResponse {
|
|
59
|
-
apps: Array<AppDeployResponse.App>;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Success message
|
|
63
|
-
*/
|
|
64
|
-
message: string;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Status of the deployment
|
|
68
|
-
*/
|
|
69
|
-
success: boolean;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export namespace AppDeployResponse {
|
|
73
|
-
export interface App {
|
|
74
|
-
/**
|
|
75
|
-
* ID for the app version deployed
|
|
76
|
-
*/
|
|
77
|
-
id: string;
|
|
78
|
-
|
|
79
|
-
actions: Array<App.Action>;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Name of the app
|
|
83
|
-
*/
|
|
84
|
-
name: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export namespace App {
|
|
88
|
-
export interface Action {
|
|
89
|
-
/**
|
|
90
|
-
* Name of the action
|
|
91
|
-
*/
|
|
92
|
-
name: string;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface AppInvokeResponse {
|
|
98
|
-
/**
|
|
99
|
-
* ID of the invocation
|
|
100
|
-
*/
|
|
101
|
-
id: string;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Status of the invocation
|
|
105
|
-
*/
|
|
106
|
-
status: 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED';
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Output from the invocation (if available)
|
|
110
|
-
*/
|
|
111
|
-
output?: string;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export interface AppRetrieveInvocationResponse {
|
|
115
|
-
id: string;
|
|
116
|
-
|
|
117
|
-
appName: string;
|
|
118
|
-
|
|
119
|
-
finishedAt: string | null;
|
|
120
|
-
|
|
121
|
-
input: string;
|
|
122
|
-
|
|
123
|
-
output: string;
|
|
124
|
-
|
|
125
|
-
startedAt: string;
|
|
126
|
-
|
|
127
|
-
status: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface AppDeployParams {
|
|
131
|
-
/**
|
|
132
|
-
* Relative path to the entrypoint of the application
|
|
133
|
-
*/
|
|
134
|
-
entrypointRelPath: string;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* ZIP file containing the application source directory
|
|
138
|
-
*/
|
|
139
|
-
file: Uploadable;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Allow overwriting an existing app version
|
|
143
|
-
*/
|
|
144
|
-
force?: 'true' | 'false';
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Region for deployment. Currently we only support "aws.us-east-1a"
|
|
148
|
-
*/
|
|
149
|
-
region?: 'aws.us-east-1a';
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Version of the application. Can be any string.
|
|
153
|
-
*/
|
|
154
|
-
version?: string;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export interface AppInvokeParams {
|
|
158
|
-
/**
|
|
159
|
-
* Name of the action to invoke
|
|
160
|
-
*/
|
|
161
|
-
actionName: string;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Name of the application
|
|
165
|
-
*/
|
|
166
|
-
appName: string;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Input data for the application
|
|
170
|
-
*/
|
|
171
|
-
payload: unknown;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Version of the application
|
|
175
|
-
*/
|
|
176
|
-
version: string;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export declare namespace Apps {
|
|
180
|
-
export {
|
|
181
|
-
type AppDeployResponse as AppDeployResponse,
|
|
182
|
-
type AppInvokeResponse as AppInvokeResponse,
|
|
183
|
-
type AppRetrieveInvocationResponse as AppRetrieveInvocationResponse,
|
|
184
|
-
type AppDeployParams as AppDeployParams,
|
|
185
|
-
type AppInvokeParams as AppInvokeParams,
|
|
186
|
-
};
|
|
187
|
-
}
|
|
3
|
+
export * from './apps/index';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Browsers extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create Browser Session
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const browser = await client.browsers.create({
|
|
15
|
+
* invocation_id: 'ckqwer3o20000jb9s7abcdef',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(body: BrowserCreateParams, options?: RequestOptions): APIPromise<BrowserCreateResponse> {
|
|
20
|
+
return this._client.post('/browsers', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get Browser Session by ID
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const browser = await client.browsers.retrieve(
|
|
29
|
+
* 'e5bf36fe-9247-4e2b-8b5a-2f594cc1c073',
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<BrowserRetrieveResponse> {
|
|
34
|
+
return this._client.get(path`/browsers/${id}`, options);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BrowserCreateResponse {
|
|
39
|
+
/**
|
|
40
|
+
* Remote URL for live viewing the browser session
|
|
41
|
+
*/
|
|
42
|
+
browser_live_view_url: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
46
|
+
*/
|
|
47
|
+
cdp_ws_url: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Unique identifier for the browser session
|
|
51
|
+
*/
|
|
52
|
+
session_id: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface BrowserRetrieveResponse {
|
|
56
|
+
/**
|
|
57
|
+
* Remote URL for live viewing the browser session
|
|
58
|
+
*/
|
|
59
|
+
browser_live_view_url: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Websocket URL for Chrome DevTools Protocol connections to the browser session
|
|
63
|
+
*/
|
|
64
|
+
cdp_ws_url: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Unique identifier for the browser session
|
|
68
|
+
*/
|
|
69
|
+
session_id: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface BrowserCreateParams {
|
|
73
|
+
/**
|
|
74
|
+
* action invocation ID
|
|
75
|
+
*/
|
|
76
|
+
invocation_id: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare namespace Browsers {
|
|
80
|
+
export {
|
|
81
|
+
type BrowserCreateResponse as BrowserCreateResponse,
|
|
82
|
+
type BrowserRetrieveResponse as BrowserRetrieveResponse,
|
|
83
|
+
type BrowserCreateParams as BrowserCreateParams,
|
|
84
|
+
};
|
|
85
|
+
}
|
package/src/resources/index.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
export { Apps } from './apps/apps';
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
type AppInvokeParams,
|
|
10
|
-
} from './apps';
|
|
11
|
-
export { Browser, type BrowserCreateSessionResponse, type BrowserCreateSessionParams } from './browser';
|
|
5
|
+
Browsers,
|
|
6
|
+
type BrowserCreateResponse,
|
|
7
|
+
type BrowserRetrieveResponse,
|
|
8
|
+
type BrowserCreateParams,
|
|
9
|
+
} from './browsers';
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.12'; // x-release-please-version
|
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.12";
|
|
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.12";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|