-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapps.ts
More file actions
129 lines (111 loc) · 2.59 KB
/
apps.ts
File metadata and controls
129 lines (111 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { type Uploadable } from '../core/uploads';
import { RequestOptions } from '../internal/request-options';
import { multipartFormRequestOptions } from '../internal/uploads';
export class Apps extends APIResource {
/**
* Deploy a new application
*
* @example
* ```ts
* const response = await client.apps.deploy({
* appName: 'my-awesome-app',
* file: fs.createReadStream('path/to/file'),
* version: '1.0.0',
* });
* ```
*/
deploy(body: AppDeployParams, options?: RequestOptions): APIPromise<AppDeployResponse> {
return this._client.post('/apps/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
}
/**
* Invoke an application
*
* @example
* ```ts
* const response = await client.apps.invoke({
* actionName: 'analyze',
* appName: 'my-awesome-app',
* payload: '{ "data": "example input" }',
* version: '1.0.0',
* });
* ```
*/
invoke(body: AppInvokeParams, options?: RequestOptions): APIPromise<AppInvokeResponse> {
return this._client.post('/apps/invoke', { body, ...options });
}
}
export interface AppDeployResponse {
/**
* ID of the deployed app version
*/
id: string;
/**
* Success message
*/
message: string;
/**
* Status of the deployment
*/
success: boolean;
}
export interface AppInvokeResponse {
/**
* ID of the invocation
*/
id: string;
/**
* Status of the invocation
*/
status: 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED';
/**
* Output from the invocation (if available)
*/
output?: string;
}
export interface AppDeployParams {
/**
* Name of the application
*/
appName: string;
/**
* ZIP file containing the application
*/
file: Uploadable;
/**
* Version of the application
*/
version: string;
/**
* AWS region for deployment (e.g. "aws.us-east-1a")
*/
region?: string;
}
export interface AppInvokeParams {
/**
* Name of the action to invoke
*/
actionName: string;
/**
* Name of the application
*/
appName: string;
/**
* Input data for the application
*/
payload: unknown;
/**
* Version of the application
*/
version: string;
}
export declare namespace Apps {
export {
type AppDeployResponse as AppDeployResponse,
type AppInvokeResponse as AppInvokeResponse,
type AppDeployParams as AppDeployParams,
type AppInvokeParams as AppInvokeParams,
};
}